<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:core="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
                    xmlns:common="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common">

    <core:Bool2VisibilityConverter x:Key="Bool2VisibilityConverter" TrueVisibility="Visible" FalseVisibility="Collapsed"></core:Bool2VisibilityConverter>

    <Style TargetType="RepeatButton" x:Key="NumberBox_Up">
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="RepeatButton">
                    <Border x:Name="border" Background="Transparent">
                        <Image Source="/VIZ.Framework.Common.Resource;component/Icons/triangle_up_16x16.png" Width="6" Height="13"
                               VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0,0,0,5"></Image>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="border" Property="Background" Value="#22FFFFFF"></Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="RepeatButton" x:Key="NumberBox_Down">
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="RepeatButton">
                    <Border x:Name="border" Background="Transparent">
                        <Image Source="/VIZ.Framework.Common.Resource;component/Icons/triangle_down_16x16.png" Width="6" Height="13"
                               VerticalAlignment="Top" HorizontalAlignment="Center" Margin="0,5,0,0"></Image>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="border" Property="Background" Value="#22FFFFFF"></Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="common:NumberBox">
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Background" Value="#ff0e131e"/>
        <Setter Property="BorderBrush" Value="#ff3d4758"/>
        <Setter Property="Foreground" Value="White"/>
        <Setter Property="FontSize" Value="16"></Setter>
        <Setter Property="BorderThickness" Value="0,0,0,1"/>
        <Setter Property="VerticalContentAlignment" Value="Center"></Setter>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="AllowDrop" Value="true"/>
        <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
        <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="common:NumberBox">
                    <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                                <ColumnDefinition Width="auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"></RowDefinition>
                                <RowDefinition Height="*"></RowDefinition>
                            </Grid.RowDefinitions>
                            <ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" Margin="5,0,5,0"
                                          VerticalScrollBarVisibility="Hidden" VerticalContentAlignment="Center" Grid.RowSpan="2"/>
                            <RepeatButton x:Name="PART_Up" Style="{StaticResource NumberBox_Up}" Width="30" 
                                          Visibility="{TemplateBinding IsShowUpAndDownButton,Converter={StaticResource Bool2VisibilityConverter}}"
                                          Grid.Column="1" Grid.Row="0" Content="Up"></RepeatButton>
                            <RepeatButton x:Name="PART_Down" Style="{StaticResource NumberBox_Down}" Width="30" 
                                          Visibility="{TemplateBinding IsShowUpAndDownButton,Converter={StaticResource Bool2VisibilityConverter}}"
                                          Grid.Column="1" Grid.Row="1" Content="Down"></RepeatButton>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Opacity" TargetName="border" Value="0.56"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>