CustomSliderControl.xaml.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. public partial class CustomSliderControl : UserControl
  18. {
  19. // The dependency property which will be accessible on the UserControl
  20. public static readonly DependencyProperty SliderWidthProperty =
  21. DependencyProperty.Register("SliderWidth", typeof(double), typeof(CustomSliderControl), new UIPropertyMetadata());
  22. public double SliderWidth
  23. {
  24. get { return (double)GetValue(SliderWidthProperty); }
  25. set { SetValue(SliderWidthProperty, value); }
  26. }
  27. public static readonly DependencyProperty SliderValueProperty =
  28. DependencyProperty.Register("SliderValue", typeof(int), typeof(CustomSliderControl), new UIPropertyMetadata());
  29. public int SliderValue
  30. {
  31. get { return (int)GetValue(SliderValueProperty); }
  32. set { SetValue(SliderValueProperty, value); }
  33. }
  34. // The dependency property which will be accessible on the UserControl
  35. public static readonly DependencyProperty MaxiumProperty =
  36. DependencyProperty.Register("Maxium", typeof(int), typeof(CustomSliderControl), new UIPropertyMetadata());
  37. public int Maxium
  38. {
  39. get { return (int)GetValue(MaxiumProperty); }
  40. set { SetValue(MaxiumProperty, value); }
  41. }
  42. public CustomSliderControl()
  43. {
  44. InitializeComponent();
  45. }
  46. }
  47. }