123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <ResourceDictionary
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:local="clr-namespace:FWindSoft.Wpf.Controls"
- xmlns:wpf="clr-namespace:FWindSoft.Wpf">
- <Style TargetType="{x:Type local:IntegerSpinner}">
- <Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
- <Setter Property="FocusVisualStyle" Value="{x:Null}" />
- <Setter Property="AllowDrop" Value="true" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type local:IntegerSpinner}">
- <Grid>
- <Border x:Name="Border" MinHeight="23" BorderThickness="1" Padding="0" BorderBrush="DarkGray" CornerRadius="2">
- <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="20" />
- </Grid.ColumnDefinitions>
- <TextBox x:Name="PART_TextBox" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
- IsReadOnly="{TemplateBinding IsReadOnly}"
- BorderThickness="0"
- Background="Transparent"
- ContextMenu="{TemplateBinding ContextMenu}"
- FontFamily="{TemplateBinding FontFamily}"
- FontSize="{TemplateBinding FontSize}"
- FontStretch="{TemplateBinding FontStretch}"
- FontStyle="{TemplateBinding FontStyle}"
- FontWeight="{TemplateBinding FontWeight}"
- Foreground="{TemplateBinding Foreground}"
- HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
- IsTabStop="True"
- MinWidth="20"
- AcceptsReturn="False"
- Padding="{TemplateBinding Padding}"
- TextWrapping="NoWrap"></TextBox>
- <Grid Grid.Column="1" Width="20" VerticalAlignment="Stretch" HorizontalAlignment="Right" Margin="0">
- <Grid.RowDefinitions>
- <RowDefinition></RowDefinition>
- <RowDefinition></RowDefinition>
- </Grid.RowDefinitions>
- <Button x:Name="PART_Up" Grid.Row="0" IsEnabled="{TemplateBinding IsReadOnly,Converter={x:Static wpf:ConverterFactory.BoolOpposition}}" VerticalAlignment="Stretch" Padding="0">
- <Path HorizontalAlignment="Center" VerticalAlignment="Center" Fill="Black" Data="M 0 0 L 4 4 L 8 0 Z" RenderTransformOrigin="0.5,0.5">
- <Path.RenderTransform>
- <RotateTransform Angle="-180" />
- </Path.RenderTransform>
- </Path>
- </Button>
- <Button x:Name="PART_Down" Grid.Row="1" IsEnabled="{TemplateBinding IsReadOnly,Converter={x:Static wpf:ConverterFactory.BoolOpposition}}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Padding="0">
- <Path HorizontalAlignment="Center" VerticalAlignment="Center" Fill="Black" Data="M 0 0 L 4 4 L 8 0 Z" RenderTransformOrigin="0.5,0.5">
- <Path.RenderTransform>
- <RotateTransform Angle="0" />
- </Path.RenderTransform>
- </Path>
- </Button>
- </Grid>
- </Grid>
- </Border>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- </ResourceDictionary>
|