12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using ComeCapture.Models;
-
- using System.Windows;
- using System.Windows.Controls.Primitives;
-
- namespace ComeCapture.Controls
- {
- public class ZoomThumb : Thumb
- {
- #region Direction DependencyProperty
-
- public Direction Direction
- {
- get => (Direction)GetValue(DirectionProperty);
- set => SetValue(DirectionProperty, value);
- }
-
- public static readonly DependencyProperty DirectionProperty =
- DependencyProperty.Register("Direction", typeof(Direction), typeof(ZoomThumb),
- new PropertyMetadata(Direction.Null, new PropertyChangedCallback(ZoomThumb.OnDirectionPropertyChanged)));
-
- private static void OnDirectionPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
- {
- if (obj is ZoomThumb)
- {
- (obj as ZoomThumb).OnDirectionValueChanged();
- }
- }
-
- protected void OnDirectionValueChanged()
- {
- if (Direction == Direction.Move)
- {
- MouseDoubleClick += (sender, e) =>
- {
- JieTuWindow.Current.OnOK();
- };
- }
- }
-
- #endregion Direction DependencyProperty
- }
- }
|