All the controls missing in WPF. Over 1 million downloads.
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.

146 lines
6.7 KiB

<!--***********************************************************************************
Toolkit for WPF
Copyright (C) 2007-2020 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
**********************************************************************************-->
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit"
xmlns:themes="clr-namespace:Xceed.Wpf.Toolkit.Themes">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../Themes/Generic/Glyphs.xaml" />
</ResourceDictionary.MergedDictionaries>
<!-- =============================================================================== -->
<!-- ButtonSpinner -->
<!-- =============================================================================== -->
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<Style TargetType="{x:Type local:ButtonSpinner}">
<Setter Property="Background"
Value="{DynamicResource {x:Static themes:ResourceKeys.ControlNormalBackgroundKey}}" />
<Setter Property="BorderBrush"
Value="{DynamicResource {x:Static themes:ResourceKeys.ControlNormalBorderKey}}" />
<Setter Property="BorderThickness"
Value="1" />
<Setter Property="Focusable"
Value="False" />
<Setter Property="HorizontalContentAlignment"
Value="Stretch" />
<Setter Property="IsTabStop"
Value="True" />
<Setter Property="Padding"
Value="1" />
<Setter Property="VerticalContentAlignment"
Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:ButtonSpinner}">
<Border x:Name="Border"
SnapsToDevicePixels="True"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="firstContentColumn"
Width="*" />
<ColumnDefinition x:Name="secondContentColumn"
Width="Auto" />
</Grid.ColumnDefinitions>
<ContentPresenter x:Name="contentPresenter"
Focusable="False"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
<Grid x:Name="gridContent"
Grid.Column="1"
Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<RepeatButton x:Name="PART_IncreaseButton"
Style="{DynamicResource {x:Static themes:ResourceKeys.SpinnerButtonStyleKey}}"
IsTabStop="{TemplateBinding IsTabStop}"
ContentTemplate="{StaticResource IncreaseGlyphNormalKey}">
</RepeatButton>
<RepeatButton x:Name="PART_DecreaseButton"
Grid.Row="1"
Style="{DynamicResource {x:Static themes:ResourceKeys.SpinnerButtonStyleKey}}"
IsTabStop="{TemplateBinding IsTabStop}"
ContentTemplate="{StaticResource DecreaseGlyphNormalKey}" >
</RepeatButton>
</Grid>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="ShowButtonSpinner"
Value="False">
<Setter Property="Visibility"
Value="Hidden"
TargetName="gridContent" />
<Setter Property="Width"
Value="0"
TargetName="gridContent" />
</Trigger>
<Trigger Property="IsEnabled"
Value="False">
<Setter Property="Background"
Value="{DynamicResource {x:Static themes:ResourceKeys.ControlDisabledBackgroundKey}}" />
</Trigger>
<Trigger SourceName="PART_IncreaseButton"
Property="IsEnabled"
Value="False">
<Setter TargetName="PART_IncreaseButton"
Property="ContentTemplate"
Value="{StaticResource IncreaseGlyphDisabledKey}" />
</Trigger>
<Trigger SourceName="PART_DecreaseButton"
Property="IsEnabled"
Value="False">
<Setter TargetName="PART_DecreaseButton"
Property="ContentTemplate"
Value="{StaticResource DecreaseGlyphDisabledKey}" />
</Trigger>
<Trigger Property="ButtonSpinnerLocation"
Value="Left">
<Setter TargetName="firstContentColumn"
Property="Width"
Value="Auto" />
<Setter TargetName="secondContentColumn"
Property="Width"
Value="*" />
<Setter TargetName="contentPresenter"
Property="Grid.Column"
Value="1" />
<Setter TargetName="gridContent"
Property="Grid.Column"
Value="0" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>