星火微课系统客户端
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

ZoomThumb.cs 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using ComeCapture.Models;
  2. using System.Windows;
  3. using System.Windows.Controls.Primitives;
  4. namespace ComeCapture.Controls
  5. {
  6. public class ZoomThumb : Thumb
  7. {
  8. #region Direction DependencyProperty
  9. public Direction Direction
  10. {
  11. get => (Direction)GetValue(DirectionProperty);
  12. set => SetValue(DirectionProperty, value);
  13. }
  14. public static readonly DependencyProperty DirectionProperty =
  15. DependencyProperty.Register("Direction", typeof(Direction), typeof(ZoomThumb),
  16. new PropertyMetadata(Direction.Null, new PropertyChangedCallback(ZoomThumb.OnDirectionPropertyChanged)));
  17. private static void OnDirectionPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
  18. {
  19. if (obj is ZoomThumb)
  20. {
  21. (obj as ZoomThumb).OnDirectionValueChanged();
  22. }
  23. }
  24. protected void OnDirectionValueChanged()
  25. {
  26. if (Direction == Direction.Move)
  27. {
  28. MouseDoubleClick += (sender, e) =>
  29. {
  30. JieTuWindow.Current.OnOK();
  31. };
  32. }
  33. }
  34. #endregion Direction DependencyProperty
  35. }
  36. }