<commit_before>﻿using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Input;
using Whathecode.System.Arithmetic.Range;
using Whathecode.System.Extensions;
using Whathecode.System.Windows.DependencyPropertyFactory;
using Whathecode.System.Windows.DependencyPropertyFactory.Attributes;


namespace Whathecode.System.Xaml.Behaviors
{
	/// <summary>
	///   Properties which can be attached to a <see cref = "FrameworkElement">FrameworkElement</see> to detect mouse behavior.
	/// </summary>
	/// <author><NAME></author>
	public static class MouseBehavior
	{
		/// <summary>
		///   The maximum distance the mouse is allowed to travel for a click to be valid.
		/// </summary>
		const double MaxClickDragDistance = 20;

		public struct MouseState
		{
			public MousePosition Position;

			public bool IsLeftButtonDown;
			public bool IsRightButtonDown;
		}


		public struct MousePosition
		{
			/// <summary>
			///   Specifies the relative mouse position to the element.
			/// </summary>
			public Point Relative;

			/// <summary>
			///   Percentage inside the element.
			/// </summary>
			public Point Percentage;
		}

		public struct ClickDragInfo
		{
			public MouseState Mouse;
			public ClickDragState State;
			public MousePosition StartPosition;
		}

		public enum ClickDragState
		{
			Start,<commit_msg>Added displacement to ClickDragInfo for MouseBehavior.<commit_after>﻿using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Input;
using Whathecode.System.Arithmetic.Range;
using Whathecode.System.Extensions;
using Whathecode.System.Windows.DependencyPropertyFactory;
using Whathecode.System.Windows.DependencyPropertyFactory.Attributes;


namespace Whathecode.System.Xaml.Behaviors
{
	/// <summary>
	///   Properties which can be attached to a <see cref = "FrameworkElement">FrameworkElement</see> to detect mouse behavior.
	/// </summary>
	/// <author><NAME></author>
	public static class MouseBehavior
	{
		/// <summary>
		///   The maximum distance the mouse is allowed to travel for a click to be valid.
		/// </summary>
		const double MaxClickDragDistance = 20;

		public struct MouseState
		{
			public MousePosition Position;

			public bool IsLeftButtonDown;
			public bool IsRightButtonDown;
		}


		public struct MousePosition
		{
			/// <summary>
			///   Specifies the relative mouse position to the element.
			/// </summary>
			public Point Relative;

			/// <summary>
			///   Percentage inside the element.
			/// </summary>
			public Point Percentage;
		}

		public struct ClickDragInfo
		{
			public MouseState Mouse;
			public ClickDragState State;
			public MousePosition StartPosition;
			public Vector Displacement
			{
				get { return Mouse.Position.Relative - StartPosition.Relative; }
			}
		}

		public enum ClickDragState
		{
			Start,
{'fraction_non_alphanumeric': 0.09473684210526316, 'fraction_numerical': 0.0014035087719298245, 'mean_word_length': 3.440809968847352, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1693106', 'n_tokens_mistral': 902, 'n_tokens_neox': 773, 'n_words': 237}