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.
92 lines
6.7 KiB
92 lines
6.7 KiB
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:local="clr-namespace:Microsoft.Windows.Controls"
|
|
xmlns:chrome="clr-namespace:Microsoft.Windows.Controls.Chromes">
|
|
|
|
<!-- =============================================================================== -->
|
|
<!-- ButtonSpinner -->
|
|
<!-- =============================================================================== -->
|
|
|
|
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
|
|
|
|
<SolidColorBrush x:Key="SpinButtonGlyphNormalForegroundFillKey" Color="#FF000000" />
|
|
|
|
<DataTemplate x:Key="IncreaseGlyph">
|
|
<Path Width="7" Height="4" Data="M 0,3 C0,3 0,4 0,4 0,4 3,4 3,4 3,4 3,3 3,3 3,3 4,3 4,3 4,3 4,4 4,4 4,4 7,4 7,4 7,4 7,3 7,3 7,3 6,3 6,3 6,3 6,2 6,2 6,2 5,2 5,2 5,2 5,1 5,1 5,1 4,1 4,1 4,1 4,0 4,0 4,0 3,0 3,0 3,0 3,1 3,1 3,1 2,1 2,1 2,1 2,2 2,2 2,2 1,2 1,2 1,2 1,3 1,3 1,3 0,3 0,3 z" Fill="{StaticResource SpinButtonGlyphNormalForegroundFillKey}"/>
|
|
</DataTemplate>
|
|
|
|
<DataTemplate x:Key="DecreaseGlyph">
|
|
<Path Width="7" Height="4" Data="M 0,1 C0,1 0,0 0,0 0,0 3,0 3,0 3,0 3,1 3,1 3,1 4,1 4,1 4,1 4,0 4,0 4,0 7,0 7,0 7,0 7,1 7,1 7,1 6,1 6,1 6,1 6,2 6,2 6,2 5,2 5,2 5,2 5,3 5,3 5,3 4,3 4,3 4,3 4,4 4,4 4,4 3,4 3,4 3,4 3,3 3,3 3,3 2,3 2,3 2,3 2,2 2,2 2,2 1,2 1,2 1,2 1,1 1,1 1,1 0,1 0,1 z" Fill="{StaticResource SpinButtonGlyphNormalForegroundFillKey}"/>
|
|
</DataTemplate>
|
|
|
|
<Style TargetType="{x:Type local:ButtonSpinner}">
|
|
<Setter Property="Focusable" Value="False" />
|
|
<Setter Property="IsTabStop" Value="True" />
|
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
<Setter Property="BorderBrush">
|
|
<Setter.Value>
|
|
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
|
<GradientStop Color="#FFA3AEB9" Offset="0" />
|
|
<GradientStop Color="#FF8399A9" Offset="0.375" />
|
|
<GradientStop Color="#FF718597" Offset="0.375" />
|
|
<GradientStop Color="#FF617584" Offset="1" />
|
|
</LinearGradientBrush>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Setter Property="Background" Value="Transparent" />
|
|
<Setter Property="BorderThickness" Value="1" />
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type local:ButtonSpinner}">
|
|
<Grid>
|
|
<Border x:Name="ElementContainer" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
|
|
<DockPanel Focusable="False">
|
|
<Grid DockPanel.Dock="Right" Visibility="{TemplateBinding ShowButtonSpinner, Converter={StaticResource BooleanToVisibilityConverter}}">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="1" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
<RepeatButton x:Name="IncreaseButton" SnapsToDevicePixels="True" Grid.Row="0" ClickMode="Press" IsTabStop="{Binding IsTabStop, RelativeSource={RelativeSource TemplatedParent}}">
|
|
<RepeatButton.Template>
|
|
<ControlTemplate TargetType="RepeatButton">
|
|
<ContentPresenter />
|
|
</ControlTemplate>
|
|
</RepeatButton.Template>
|
|
<Grid>
|
|
<chrome:ButtonChrome CornerRadius="0"
|
|
RenderEnabled="{TemplateBinding IsEnabled}"
|
|
RenderMouseOver="{Binding IsMouseOver, ElementName=IncreaseButton}"
|
|
RenderPressed="{Binding IsPressed, ElementName=IncreaseButton}"/>
|
|
<ContentControl ContentTemplate="{StaticResource IncreaseGlyph}" Margin="5,1" Focusable="False" />
|
|
</Grid>
|
|
</RepeatButton>
|
|
<RepeatButton x:Name="DecreaseButton" SnapsToDevicePixels="True" Grid.Row="2" ClickMode="Press" IsTabStop="{Binding IsTabStop, RelativeSource={RelativeSource TemplatedParent}}" >
|
|
<RepeatButton.Template>
|
|
<ControlTemplate TargetType="RepeatButton">
|
|
<ContentPresenter />
|
|
</ControlTemplate>
|
|
</RepeatButton.Template>
|
|
<Grid>
|
|
<chrome:ButtonChrome CornerRadius="0"
|
|
RenderEnabled="{TemplateBinding IsEnabled}"
|
|
RenderMouseOver="{Binding IsMouseOver, ElementName=DecreaseButton}"
|
|
RenderPressed="{Binding IsPressed, ElementName=DecreaseButton}"/>
|
|
<ContentControl ContentTemplate="{StaticResource DecreaseGlyph}" Margin="5,1" Focusable="False" />
|
|
</Grid>
|
|
</RepeatButton>
|
|
</Grid>
|
|
<ContentControl x:Name="presentationSite" Focusable="False"
|
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
Content="{TemplateBinding Content}" />
|
|
</DockPanel>
|
|
</Border>
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
</ResourceDictionary>
|