/Xceed.Wpf.Toolkit/ButtonSpinner/Themes/Generic.xaml

https://github.com/xyshyniaphy/TestRx · XAML · 86 lines · 58 code · 10 blank · 18 comment · 0 complexity · 7df808ec5928ca1ab46eb34e95a72eea MD5 · raw file

  1. <!--***********************************************************************************
  2. Extended WPF Toolkit
  3. Copyright (C) 2007-2013 Xceed Software Inc.
  4. This program is provided to you under the terms of the Microsoft Public
  5. License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
  6. For more features, controls, and fast professional support,
  7. pick up the Plus Edition at http://xceed.com/wpf_toolkit
  8. Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
  9. **********************************************************************************-->
  10. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  11. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  12. xmlns:local="clr-namespace:Xceed.Wpf.Toolkit"
  13. xmlns:themes="clr-namespace:Xceed.Wpf.Toolkit.Themes">
  14. <ResourceDictionary.MergedDictionaries>
  15. <ResourceDictionary Source="../../Themes/Generic/Glyphs.xaml" />
  16. </ResourceDictionary.MergedDictionaries>
  17. <!-- =============================================================================== -->
  18. <!-- ButtonSpinner -->
  19. <!-- =============================================================================== -->
  20. <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
  21. <Style TargetType="{x:Type local:ButtonSpinner}">
  22. <Setter Property="Background" Value="{DynamicResource {x:Static themes:ResourceKeys.ControlNormalBackgroundKey}}" />
  23. <Setter Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ControlNormalBorderKey}}" />
  24. <Setter Property="BorderThickness" Value="1" />
  25. <Setter Property="Focusable" Value="False" />
  26. <Setter Property="HorizontalContentAlignment" Value="Stretch" />
  27. <Setter Property="IsTabStop" Value="True" />
  28. <Setter Property="Padding" Value="1" />
  29. <Setter Property="VerticalContentAlignment" Value="Center" />
  30. <Setter Property="Template">
  31. <Setter.Value>
  32. <ControlTemplate TargetType="{x:Type local:ButtonSpinner}">
  33. <Border x:Name="Border" SnapsToDevicePixels="True" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" >
  34. <Grid>
  35. <Grid.ColumnDefinitions>
  36. <ColumnDefinition Width="*" />
  37. <ColumnDefinition Width="Auto" />
  38. </Grid.ColumnDefinitions>
  39. <ContentPresenter Focusable="False" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
  40. <Grid Grid.Column="1" Visibility="{TemplateBinding ShowButtonSpinner, Converter={StaticResource BooleanToVisibilityConverter}}" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}">
  41. <Grid.RowDefinitions>
  42. <RowDefinition Height="*" />
  43. <RowDefinition Height="*" />
  44. </Grid.RowDefinitions>
  45. <RepeatButton x:Name="PART_IncreaseButton"
  46. Style="{DynamicResource {x:Static themes:ResourceKeys.SpinnerButtonStyleKey}}"
  47. IsTabStop="{TemplateBinding IsTabStop}" ContentTemplate="{StaticResource IncreaseGlyphNormalKey}" />
  48. <RepeatButton x:Name="PART_DecreaseButton"
  49. Grid.Row="1"
  50. Style="{DynamicResource {x:Static themes:ResourceKeys.SpinnerButtonStyleKey}}"
  51. IsTabStop="{TemplateBinding IsTabStop}" ContentTemplate="{StaticResource DecreaseGlyphNormalKey}" />
  52. </Grid>
  53. </Grid>
  54. </Border>
  55. <ControlTemplate.Triggers>
  56. <Trigger Property="IsEnabled" Value="False">
  57. <Setter Property="Background" Value="{DynamicResource {x:Static themes:ResourceKeys.ControlDisabledBackgroundKey}}" />
  58. </Trigger>
  59. <Trigger SourceName="PART_IncreaseButton" Property="IsEnabled" Value="False">
  60. <Setter TargetName="PART_IncreaseButton" Property="ContentTemplate" Value="{StaticResource IncreaseGlyphDisabledKey}" />
  61. </Trigger>
  62. <Trigger SourceName="PART_DecreaseButton" Property="IsEnabled" Value="False">
  63. <Setter TargetName="PART_DecreaseButton" Property="ContentTemplate" Value="{StaticResource DecreaseGlyphDisabledKey}" />
  64. </Trigger>
  65. </ControlTemplate.Triggers>
  66. </ControlTemplate>
  67. </Setter.Value>
  68. </Setter>
  69. </Style>
  70. </ResourceDictionary>