CustomSliderControl.xaml.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15. namespace Compdfkit_Tools.Common
  16. {
  17. /// <summary>
  18. /// CustomSlider.xaml 的交互逻辑
  19. /// </summary>
  20. public partial class CustomSliderControl : UserControl
  21. {
  22. // The dependency property which will be accessible on the UserControl
  23. public static readonly DependencyProperty SliderWidthProperty =
  24. DependencyProperty.Register("SliderWidth", typeof(double), typeof(CustomSliderControl), new UIPropertyMetadata());
  25. public double SliderWidth
  26. {
  27. get { return (double)GetValue(SliderWidthProperty); }
  28. set { SetValue(SliderWidthProperty, value); }
  29. }
  30. public static readonly DependencyProperty SliderValueProperty =
  31. DependencyProperty.Register("SliderValue", typeof(int), typeof(CustomSliderControl), new UIPropertyMetadata());
  32. public int SliderValue
  33. {
  34. get { return (int)GetValue(SliderValueProperty); }
  35. set { SetValue(SliderValueProperty, value); }
  36. }
  37. // The dependency property which will be accessible on the UserControl
  38. public static readonly DependencyProperty MaxiumProperty =
  39. DependencyProperty.Register("Maxium", typeof(int), typeof(CustomSliderControl), new UIPropertyMetadata());
  40. public int Maxium
  41. {
  42. get { return (int)GetValue(MaxiumProperty); }
  43. set { SetValue(MaxiumProperty, value); }
  44. }
  45. public CustomSliderControl()
  46. {
  47. InitializeComponent();
  48. }
  49. }
  50. }