SlidComboControl.xaml 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. <UserControl
  2. x:Class="PDF_Office.CustomControl.CompositeControl.SlidComboControl"
  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:PDF_Office.CustomControl.CompositeControl"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. x:Name="usercontrol"
  9. d:DesignHeight="64"
  10. d:DesignWidth="228"
  11. Loaded="UserControl_Loaded"
  12. mc:Ignorable="d">
  13. <UserControl.Resources>
  14. <ResourceDictionary>
  15. <ResourceDictionary.MergedDictionaries>
  16. <ResourceDictionary Source="../../Styles/SliderStyle.xaml" />
  17. <ResourceDictionary Source="../../Styles/CustomBtnStyle.xaml" />
  18. </ResourceDictionary.MergedDictionaries>
  19. <DataTemplate x:Key="numberData">
  20. <Grid>
  21. <TextBlock
  22. HorizontalAlignment="Center"
  23. VerticalAlignment="Center"
  24. Text="{Binding Content}" />
  25. </Grid>
  26. </DataTemplate>
  27. <Style
  28. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  29. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  30. xmlns:s="clr-namespace:System;assembly=mscorlib"
  31. x:Key="RoundThumbSlider"
  32. TargetType="{x:Type Slider}">
  33. <Style.Triggers>
  34. <Trigger Property="Slider.Orientation" Value="Vertical">
  35. <Setter Property="Control.Template">
  36. <Setter.Value>
  37. <ControlTemplate TargetType="{x:Type Slider}">
  38. <Border
  39. Name="border"
  40. Background="{TemplateBinding Panel.Background}"
  41. BorderBrush="{TemplateBinding Border.BorderBrush}"
  42. BorderThickness="{TemplateBinding Border.BorderThickness}"
  43. SnapsToDevicePixels="True">
  44. <Grid>
  45. <Grid.ColumnDefinitions>
  46. <ColumnDefinition Width="Auto" />
  47. <ColumnDefinition Width="Auto" MinWidth="{TemplateBinding FrameworkElement.MinWidth}" />
  48. <ColumnDefinition Width="Auto" />
  49. </Grid.ColumnDefinitions>
  50. <TickBar
  51. Name="TopTick"
  52. Grid.Column="0"
  53. Width="4"
  54. Margin="0,0,2,0"
  55. Fill="{TemplateBinding TextElement.Foreground}"
  56. Placement="Left"
  57. Visibility="Collapsed" />
  58. <TickBar
  59. Name="BottomTick"
  60. Grid.Column="2"
  61. Width="4"
  62. Margin="2,0,0,0"
  63. Fill="{TemplateBinding TextElement.Foreground}"
  64. Placement="Right"
  65. Visibility="Collapsed" />
  66. <Border
  67. Name="TrackBackground"
  68. Grid.Column="1"
  69. Width="4"
  70. Margin="0,5"
  71. HorizontalAlignment="Center"
  72. Background="#E7EAEA"
  73. BorderBrush="#D6D6D6"
  74. BorderThickness="1">
  75. <Canvas Margin="-1,-6">
  76. <Rectangle
  77. Name="PART_SelectionRange"
  78. Width="4"
  79. Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"
  80. Visibility="Hidden" />
  81. </Canvas>
  82. </Border>
  83. <Track Name="PART_Track" Grid.Column="1">
  84. <Track.DecreaseRepeatButton>
  85. <RepeatButton>
  86. <RepeatButton.Command>
  87. <RoutedCommand />
  88. </RepeatButton.Command>
  89. <RepeatButton.Style>
  90. <Style TargetType="{x:Type RepeatButton}">
  91. <Setter Property="FrameworkElement.OverridesDefaultStyle" Value="True" />
  92. <Setter Property="Panel.Background" Value="#00FFFFFF" />
  93. <Setter Property="UIElement.Focusable" Value="False" />
  94. <Setter Property="KeyboardNavigation.IsTabStop" Value="False" />
  95. <Setter Property="Control.Template">
  96. <Setter.Value>
  97. <ControlTemplate TargetType="{x:Type RepeatButton}">
  98. <Rectangle
  99. Width="{TemplateBinding FrameworkElement.Width}"
  100. Height="2"
  101. Fill="{TemplateBinding Panel.Background}" />
  102. </ControlTemplate>
  103. </Setter.Value>
  104. </Setter>
  105. </Style>
  106. </RepeatButton.Style>
  107. </RepeatButton>
  108. </Track.DecreaseRepeatButton>
  109. <Track.Thumb>
  110. <Thumb
  111. Name="Thumb"
  112. Width="18"
  113. Height="11"
  114. VerticalAlignment="Top"
  115. Focusable="False"
  116. OverridesDefaultStyle="True">
  117. <Thumb.Template>
  118. <ControlTemplate TargetType="{x:Type Thumb}">
  119. <Grid
  120. HorizontalAlignment="Center"
  121. VerticalAlignment="Center"
  122. UseLayoutRounding="True">
  123. <Path
  124. Name="grip"
  125. VerticalAlignment="Center"
  126. Fill="#477EDE"
  127. SnapsToDevicePixels="True"
  128. Stretch="Fill"
  129. Stroke="#477EDE"
  130. StrokeThickness="1"
  131. UseLayoutRounding="True">
  132. <Path.Data>
  133. <RectangleGeometry
  134. RadiusX="4"
  135. RadiusY="4"
  136. Rect="0,0,8,16" />
  137. </Path.Data>
  138. </Path>
  139. </Grid>
  140. <ControlTemplate.Triggers>
  141. <Trigger Property="UIElement.IsMouseOver" Value="True">
  142. <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
  143. <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
  144. </Trigger>
  145. <Trigger Property="Thumb.IsDragging" Value="True">
  146. <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
  147. <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
  148. </Trigger>
  149. <Trigger Property="UIElement.IsEnabled" Value="False">
  150. <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
  151. <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
  152. </Trigger>
  153. </ControlTemplate.Triggers>
  154. </ControlTemplate>
  155. </Thumb.Template>
  156. </Thumb>
  157. </Track.Thumb>
  158. <Track.IncreaseRepeatButton>
  159. <RepeatButton>
  160. <RepeatButton.Command>
  161. <RoutedCommand />
  162. </RepeatButton.Command>
  163. <RepeatButton.Style>
  164. <Style TargetType="{x:Type RepeatButton}">
  165. <Setter Property="FrameworkElement.OverridesDefaultStyle" Value="True" />
  166. <Setter Property="Panel.Background" Value="#00FFFFFF" />
  167. <Setter Property="UIElement.Focusable" Value="False" />
  168. <Setter Property="KeyboardNavigation.IsTabStop" Value="False" />
  169. <Setter Property="Control.Template">
  170. <Setter.Value>
  171. <ControlTemplate TargetType="{x:Type RepeatButton}">
  172. <Rectangle
  173. Width="{TemplateBinding FrameworkElement.Width}"
  174. Height="2"
  175. Fill="{TemplateBinding Panel.Background}" />
  176. </ControlTemplate>
  177. </Setter.Value>
  178. </Setter>
  179. </Style>
  180. </RepeatButton.Style>
  181. </RepeatButton>
  182. </Track.IncreaseRepeatButton>
  183. </Track>
  184. </Grid>
  185. </Border>
  186. <ControlTemplate.Triggers>
  187. <Trigger Property="Slider.TickPlacement" Value="TopLeft">
  188. <Setter TargetName="TopTick" Property="UIElement.Visibility" Value="Visible" />
  189. <Setter TargetName="Thumb" Property="Control.Template">
  190. <Setter.Value>
  191. <ControlTemplate TargetType="{x:Type Thumb}">
  192. <Grid
  193. HorizontalAlignment="Center"
  194. VerticalAlignment="Center"
  195. UseLayoutRounding="True">
  196. <Path
  197. Name="grip"
  198. VerticalAlignment="Center"
  199. Fill="#477EDE"
  200. SnapsToDevicePixels="True"
  201. Stretch="Fill"
  202. Stroke="#477EDE"
  203. StrokeThickness="1"
  204. UseLayoutRounding="True">
  205. <Path.Data>
  206. <RectangleGeometry
  207. RadiusX="4"
  208. RadiusY="4"
  209. Rect="0,0,8,16" />
  210. </Path.Data>
  211. </Path>
  212. </Grid>
  213. <ControlTemplate.Triggers>
  214. <Trigger Property="UIElement.IsMouseOver" Value="True">
  215. <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
  216. <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
  217. </Trigger>
  218. <Trigger Property="Thumb.IsDragging" Value="True">
  219. <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
  220. <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
  221. </Trigger>
  222. <Trigger Property="UIElement.IsEnabled" Value="False">
  223. <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
  224. <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
  225. </Trigger>
  226. </ControlTemplate.Triggers>
  227. </ControlTemplate>
  228. </Setter.Value>
  229. </Setter>
  230. <Setter TargetName="TrackBackground" Property="FrameworkElement.Margin" Value="2,5,0,5" />
  231. </Trigger>
  232. <Trigger Property="Slider.TickPlacement" Value="BottomRight">
  233. <Setter TargetName="BottomTick" Property="UIElement.Visibility" Value="Visible" />
  234. <Setter TargetName="Thumb" Property="Control.Template">
  235. <Setter.Value>
  236. <ControlTemplate TargetType="{x:Type Thumb}">
  237. <Grid
  238. HorizontalAlignment="Center"
  239. VerticalAlignment="Center"
  240. UseLayoutRounding="True">
  241. <Path
  242. Name="grip"
  243. VerticalAlignment="Center"
  244. Fill="#477EDE"
  245. SnapsToDevicePixels="True"
  246. Stretch="Fill"
  247. Stroke="#477EDE"
  248. StrokeThickness="1"
  249. UseLayoutRounding="True">
  250. <Path.Data>
  251. <RectangleGeometry
  252. RadiusX="4"
  253. RadiusY="4"
  254. Rect="0,0,8,16" />
  255. </Path.Data>
  256. </Path>
  257. </Grid>
  258. <ControlTemplate.Triggers>
  259. <Trigger Property="UIElement.IsMouseOver" Value="True">
  260. <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
  261. <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
  262. </Trigger>
  263. <Trigger Property="Thumb.IsDragging" Value="True">
  264. <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
  265. <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
  266. </Trigger>
  267. <Trigger Property="UIElement.IsEnabled" Value="False">
  268. <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
  269. <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
  270. </Trigger>
  271. </ControlTemplate.Triggers>
  272. </ControlTemplate>
  273. </Setter.Value>
  274. </Setter>
  275. <Setter TargetName="TrackBackground" Property="FrameworkElement.Margin" Value="0,5,2,5" />
  276. </Trigger>
  277. <Trigger Property="Slider.TickPlacement" Value="Both">
  278. <Setter TargetName="TopTick" Property="UIElement.Visibility" Value="Visible" />
  279. <Setter TargetName="BottomTick" Property="UIElement.Visibility" Value="Visible" />
  280. </Trigger>
  281. <Trigger Property="Slider.IsSelectionRangeEnabled" Value="True">
  282. <Setter TargetName="PART_SelectionRange" Property="UIElement.Visibility" Value="Visible" />
  283. </Trigger>
  284. <Trigger Property="UIElement.IsKeyboardFocused" Value="True">
  285. <Setter TargetName="Thumb" Property="TextElement.Foreground" Value="#0000FF" />
  286. </Trigger>
  287. </ControlTemplate.Triggers>
  288. </ControlTemplate>
  289. </Setter.Value>
  290. </Setter>
  291. </Trigger>
  292. </Style.Triggers>
  293. <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False" />
  294. <Setter Property="Panel.Background" Value="#00FFFFFF" />
  295. <Setter Property="Border.BorderBrush" Value="#00FFFFFF" />
  296. <Setter Property="TextElement.Foreground" Value="#E5E5E5" />
  297. <Setter Property="Control.Template">
  298. <Setter.Value>
  299. <ControlTemplate TargetType="{x:Type Slider}">
  300. <Border
  301. Name="border"
  302. Background="{TemplateBinding Panel.Background}"
  303. BorderBrush="{TemplateBinding Border.BorderBrush}"
  304. BorderThickness="{TemplateBinding Border.BorderThickness}"
  305. SnapsToDevicePixels="True">
  306. <Grid>
  307. <Grid.RowDefinitions>
  308. <RowDefinition Height="Auto" />
  309. <RowDefinition Height="Auto" MinHeight="{TemplateBinding FrameworkElement.MinHeight}" />
  310. <RowDefinition Height="Auto" />
  311. </Grid.RowDefinitions>
  312. <TickBar
  313. Name="TopTick"
  314. Grid.Row="0"
  315. Height="4"
  316. Margin="0,2,0,0"
  317. Fill="{TemplateBinding TextElement.Foreground}"
  318. Placement="Top"
  319. Visibility="Collapsed" />
  320. <TickBar
  321. Name="BottomTick"
  322. Grid.Row="2"
  323. Height="4"
  324. Margin="0,0,0,2"
  325. Fill="{TemplateBinding TextElement.Foreground}"
  326. Placement="Bottom"
  327. Visibility="Collapsed" />
  328. <Border
  329. Name="TrackBackground"
  330. Grid.Row="1"
  331. Height="4"
  332. Margin="5,0"
  333. VerticalAlignment="Center"
  334. Background="#FFE2E3E6"
  335. BorderBrush="#D6D6D6"
  336. BorderThickness="0">
  337. <Canvas Margin="-6,-1">
  338. <Rectangle
  339. Name="PART_SelectionRange"
  340. Height="4"
  341. Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"
  342. Visibility="Hidden" />
  343. </Canvas>
  344. </Border>
  345. <Track Name="PART_Track" Grid.Row="1">
  346. <Track.DecreaseRepeatButton>
  347. <RepeatButton>
  348. <RepeatButton.Command>
  349. <RoutedCommand />
  350. </RepeatButton.Command>
  351. <RepeatButton.Style>
  352. <Style TargetType="{x:Type RepeatButton}">
  353. <Setter Property="FrameworkElement.OverridesDefaultStyle" Value="True" />
  354. <Setter Property="Panel.Background" Value="#00FFFFFF" />
  355. <Setter Property="UIElement.Focusable" Value="False" />
  356. <Setter Property="KeyboardNavigation.IsTabStop" Value="False" />
  357. <Setter Property="Control.Template">
  358. <Setter.Value>
  359. <ControlTemplate TargetType="{x:Type RepeatButton}">
  360. <Rectangle
  361. Width="{TemplateBinding FrameworkElement.Width}"
  362. Height="{TemplateBinding FrameworkElement.Height}"
  363. Fill="{TemplateBinding Panel.Background}" />
  364. </ControlTemplate>
  365. </Setter.Value>
  366. </Setter>
  367. </Style>
  368. </RepeatButton.Style>
  369. </RepeatButton>
  370. </Track.DecreaseRepeatButton>
  371. <Track.Thumb>
  372. <Thumb
  373. Name="Thumb"
  374. Width="14"
  375. Height="14"
  376. VerticalAlignment="Center"
  377. Focusable="False"
  378. OverridesDefaultStyle="True">
  379. <Thumb.Template>
  380. <ControlTemplate TargetType="{x:Type Thumb}">
  381. <Grid
  382. HorizontalAlignment="Center"
  383. VerticalAlignment="Center"
  384. UseLayoutRounding="True">
  385. <Path
  386. Name="grip"
  387. VerticalAlignment="Center"
  388. Effect="{StaticResource shadow.neutral.s}"
  389. Fill="{StaticResource color.slider.track-filled.norm}"
  390. SnapsToDevicePixels="True"
  391. Stretch="Fill"
  392. Stroke="{StaticResource color.slider.knob.border}"
  393. StrokeThickness="2"
  394. UseLayoutRounding="True">
  395. <Path.Data>
  396. <EllipseGeometry
  397. Center="14,14"
  398. RadiusX="7"
  399. RadiusY="7" />
  400. </Path.Data>
  401. </Path>
  402. </Grid>
  403. <ControlTemplate.Triggers>
  404. <!--<Trigger Property="UIElement.IsMouseOver" Value="True">
  405. <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
  406. <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
  407. </Trigger>
  408. <Trigger Property="Thumb.IsDragging" Value="True">
  409. <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
  410. <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
  411. </Trigger>
  412. <Trigger Property="UIElement.IsEnabled" Value="False">
  413. <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
  414. <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
  415. </Trigger>-->
  416. </ControlTemplate.Triggers>
  417. </ControlTemplate>
  418. </Thumb.Template>
  419. </Thumb>
  420. </Track.Thumb>
  421. <Track.IncreaseRepeatButton>
  422. <RepeatButton>
  423. <RepeatButton.Command>
  424. <RoutedCommand />
  425. </RepeatButton.Command>
  426. <RepeatButton.Style>
  427. <Style TargetType="{x:Type RepeatButton}">
  428. <Setter Property="FrameworkElement.OverridesDefaultStyle" Value="True" />
  429. <Setter Property="Panel.Background" Value="#00FFFFFF" />
  430. <Setter Property="UIElement.Focusable" Value="False" />
  431. <Setter Property="KeyboardNavigation.IsTabStop" Value="False" />
  432. <Setter Property="Control.Template">
  433. <Setter.Value>
  434. <ControlTemplate TargetType="{x:Type RepeatButton}">
  435. <Rectangle
  436. Width="{TemplateBinding FrameworkElement.Width}"
  437. Height="{TemplateBinding FrameworkElement.Height}"
  438. Fill="{TemplateBinding Panel.Background}" />
  439. </ControlTemplate>
  440. </Setter.Value>
  441. </Setter>
  442. </Style>
  443. </RepeatButton.Style>
  444. </RepeatButton>
  445. </Track.IncreaseRepeatButton>
  446. </Track>
  447. </Grid>
  448. </Border>
  449. <ControlTemplate.Triggers>
  450. <Trigger Property="Slider.TickPlacement" Value="TopLeft">
  451. <Setter TargetName="TopTick" Property="UIElement.Visibility" Value="Visible" />
  452. <Setter TargetName="Thumb" Property="Control.Template">
  453. <Setter.Value>
  454. <ControlTemplate TargetType="{x:Type Thumb}">
  455. <Grid
  456. HorizontalAlignment="Center"
  457. VerticalAlignment="Center"
  458. UseLayoutRounding="True">
  459. <Path
  460. Name="grip"
  461. VerticalAlignment="Center"
  462. Fill="#477EDE"
  463. SnapsToDevicePixels="True"
  464. Stretch="Fill"
  465. Stroke="#477EDE"
  466. StrokeThickness="1"
  467. UseLayoutRounding="True">
  468. <Path.Data>
  469. <RectangleGeometry
  470. RadiusX="4"
  471. RadiusY="4"
  472. Rect="0,0,8,16" />
  473. </Path.Data>
  474. </Path>
  475. </Grid>
  476. <ControlTemplate.Triggers>
  477. <Trigger Property="UIElement.IsMouseOver" Value="True">
  478. <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
  479. <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
  480. </Trigger>
  481. <Trigger Property="Thumb.IsDragging" Value="True">
  482. <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
  483. <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
  484. </Trigger>
  485. <Trigger Property="UIElement.IsEnabled" Value="False">
  486. <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
  487. <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
  488. </Trigger>
  489. </ControlTemplate.Triggers>
  490. </ControlTemplate>
  491. </Setter.Value>
  492. </Setter>
  493. <Setter TargetName="TrackBackground" Property="FrameworkElement.Margin" Value="5,2,5,0" />
  494. </Trigger>
  495. <Trigger Property="Slider.TickPlacement" Value="BottomRight">
  496. <Setter TargetName="BottomTick" Property="UIElement.Visibility" Value="Visible" />
  497. <Setter TargetName="Thumb" Property="Control.Template">
  498. <Setter.Value>
  499. <ControlTemplate TargetType="{x:Type Thumb}">
  500. <Grid
  501. HorizontalAlignment="Center"
  502. VerticalAlignment="Center"
  503. UseLayoutRounding="True">
  504. <Path
  505. Name="grip"
  506. VerticalAlignment="Center"
  507. Fill="#477EDE"
  508. SnapsToDevicePixels="True"
  509. Stretch="Fill"
  510. Stroke="#477EDE"
  511. StrokeThickness="1"
  512. UseLayoutRounding="True">
  513. <Path.Data>
  514. <RectangleGeometry
  515. RadiusX="4"
  516. RadiusY="4"
  517. Rect="0,0,8,16" />
  518. </Path.Data>
  519. </Path>
  520. </Grid>
  521. <ControlTemplate.Triggers>
  522. <Trigger Property="UIElement.IsMouseOver" Value="True">
  523. <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
  524. <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
  525. </Trigger>
  526. <Trigger Property="Thumb.IsDragging" Value="True">
  527. <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
  528. <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
  529. </Trigger>
  530. <Trigger Property="UIElement.IsEnabled" Value="False">
  531. <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
  532. <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
  533. </Trigger>
  534. </ControlTemplate.Triggers>
  535. </ControlTemplate>
  536. </Setter.Value>
  537. </Setter>
  538. <Setter TargetName="TrackBackground" Property="FrameworkElement.Margin" Value="5,0,5,2" />
  539. </Trigger>
  540. <Trigger Property="Slider.TickPlacement" Value="Both">
  541. <Setter TargetName="TopTick" Property="UIElement.Visibility" Value="Visible" />
  542. <Setter TargetName="BottomTick" Property="UIElement.Visibility" Value="Visible" />
  543. </Trigger>
  544. <Trigger Property="Slider.IsSelectionRangeEnabled" Value="True">
  545. <Setter TargetName="PART_SelectionRange" Property="UIElement.Visibility" Value="Visible" />
  546. </Trigger>
  547. <Trigger Property="UIElement.IsKeyboardFocused" Value="True">
  548. <Setter TargetName="Thumb" Property="TextElement.Foreground" Value="#0000FF" />
  549. </Trigger>
  550. </ControlTemplate.Triggers>
  551. </ControlTemplate>
  552. </Setter.Value>
  553. </Setter>
  554. <Setter Property="SelectionStart" Value="{Binding Minimum, RelativeSource={RelativeSource Self}}" />
  555. <Setter Property="SelectionEnd" Value="{Binding Value, RelativeSource={RelativeSource Self}}" />
  556. </Style>
  557. </ResourceDictionary>
  558. </UserControl.Resources>
  559. <Grid Margin="0,16,0,0">
  560. <Grid.RowDefinitions>
  561. <RowDefinition Height="Auto" />
  562. <RowDefinition />
  563. </Grid.RowDefinitions>
  564. <TextBlock
  565. x:Name="thicknessText"
  566. Margin="0,0,0,10"
  567. FontFamily="Segoe UI"
  568. FontSize="14"
  569. Foreground="{StaticResource color.sys.text.neutral.lv2}"
  570. LineHeight="20">
  571. Thickness
  572. </TextBlock>
  573. <Grid Grid.Row="1">
  574. <Grid.ColumnDefinitions>
  575. <ColumnDefinition Width="*" />
  576. <ColumnDefinition Width="auto" />
  577. </Grid.ColumnDefinitions>
  578. <Slider
  579. Name="ThicknessSlider"
  580. HorizontalAlignment="Stretch"
  581. VerticalAlignment="Center"
  582. IsMoveToPointEnabled="True"
  583. IsSelectionRangeEnabled="True"
  584. IsSnapToTickEnabled="True"
  585. Maximum="24"
  586. Minimum="0"
  587. PreviewMouseMove="ThicknessSlider_PreviewMouseMove"
  588. Style="{DynamicResource RoundThumbSlider}"
  589. TickFrequency="1"
  590. Value="{Binding ElementName=usercontrol, Path=Value}">
  591. <Slider.Resources>
  592. <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#1770F4" />
  593. <SolidColorBrush x:Key="{x:Static SystemColors.ControlDarkDarkBrushKey}" Color="#CED0D4" />
  594. </Slider.Resources>
  595. </Slider>
  596. <local:CustomComboControl
  597. x:Name="combox"
  598. Grid.Column="1"
  599. Width="80"
  600. Height="32" />
  601. </Grid>
  602. </Grid>
  603. </UserControl>