星火微课系统客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UC_MultiRangeSlider.xaml 3.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <UserControl
  2. x:Class="XHWK.WKTool.UC_MultiRangeSlider"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:XHWK.WKTool.UControl"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. Name="UC_Arrange"
  9. Loaded="UC_Arrange_Loaded"
  10. mc:Ignorable="d">
  11. <StackPanel Height="{Binding ElementName=UC_Arrange, Path=SilderHeight}" Orientation="Horizontal">
  12. <TextBox
  13. Width="10"
  14. Margin="0,3"
  15. HorizontalAlignment="Left"
  16. VerticalAlignment="Center"
  17. BorderBrush="CornflowerBlue"
  18. KeyUp="TextBox_KeyUp1"
  19. Text="{Binding ElementName=SL_Bat1, Path=Value, Mode=TwoWay}"
  20. Visibility="Hidden" />
  21. <Canvas Width="{Binding ElementName=UC_Arrange, Path=SilderWidth}" Margin="0">
  22. <Slider
  23. Name="SL_Bat1"
  24. Width="{Binding ElementName=UC_Arrange, Path=SilderWidth}"
  25. Margin="2"
  26. VerticalAlignment="Center"
  27. FocusVisualStyle="{x:Null}"
  28. IsSelectionRangeEnabled="True"
  29. IsSnapToTickEnabled="True"
  30. Maximum="{Binding ElementName=UC_Arrange, Path=Maximum}"
  31. Minimum="{Binding ElementName=UC_Arrange, Path=Minimum}"
  32. SelectionEnd="{Binding ElementName=UC_Arrange, Path=EndValue}"
  33. SelectionStart="{Binding ElementName=UC_Arrange, Path=StartValue}"
  34. TickFrequency="{Binding ElementName=UC_Arrange, Path=SliderTickFrequency}"
  35. TickPlacement="TopLeft"
  36. ValueChanged="SL_Bat1_ValueChanged"
  37. Value="{Binding ElementName=UC_Arrange, Path=StartValue}">
  38. <Slider.Clip>
  39. <RectangleGeometry Rect="{Binding ElementName=UC_Arrange, Path=StartRect}" />
  40. </Slider.Clip>
  41. </Slider>
  42. <Slider
  43. Name="SL_Bat2"
  44. Width="{Binding ElementName=UC_Arrange, Path=SilderWidth}"
  45. Margin="2"
  46. VerticalAlignment="Center"
  47. FocusVisualStyle="{x:Null}"
  48. IsSelectionRangeEnabled="True"
  49. IsSnapToTickEnabled="True"
  50. Maximum="{Binding ElementName=UC_Arrange, Path=Maximum}"
  51. Minimum="{Binding ElementName=UC_Arrange, Path=Minimum}"
  52. SelectionEnd="{Binding ElementName=UC_Arrange, Path=EndValue}"
  53. SelectionStart="{Binding ElementName=UC_Arrange, Path=StartValue}"
  54. TickFrequency="{Binding ElementName=UC_Arrange, Path=SliderTickFrequency}"
  55. TickPlacement="TopLeft"
  56. ValueChanged="SL_Bat2_ValueChanged"
  57. Value="{Binding ElementName=UC_Arrange, Path=EndValue}">
  58. <Slider.Clip>
  59. <RectangleGeometry Rect="{Binding ElementName=UC_Arrange, Path=EndRect}" />
  60. </Slider.Clip>
  61. </Slider>
  62. </Canvas>
  63. <TextBox
  64. Width="10"
  65. Margin="0,3"
  66. HorizontalAlignment="Right"
  67. VerticalAlignment="Center"
  68. BorderBrush="CornflowerBlue"
  69. KeyUp="TextBox_KeyUp2"
  70. Text="{Binding ElementName=SL_Bat2, Path=Value, Mode=TwoWay}"
  71. Visibility="Hidden" />
  72. </StackPanel>
  73. </UserControl>