	  
	   
    
		

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c1="clr-namespace:C1.WPF" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">
	<ResourceDictionary.MergedDictionaries>
		<ResourceDictionary Source="/C1.WPF.4;component/themes/Common.xaml" />
		<ResourceDictionary Source="/C1.WPF.4;component/themes/C1Button.xaml" />
	</ResourceDictionary.MergedDictionaries>

	<!--****************** C1NumericBox ******************-->

	<Style TargetType="c1:C1NumericBox">
        
        
        <Setter Property="BorderBrush" Value="{StaticResource WpfInputBorderBrush}" />
        <Setter Property="MouseOverBrush" Value="{StaticResource WpfInputMouseOverBrush}" />
        <Setter Property="PressedBrush" Value="{StaticResource WpfInputSelectedBackground}" />
        <Setter Property="FocusBrush" Value="{StaticResource WpfInputFocusBrush}" />
        <Setter Property="ButtonBackground" Value="{StaticResource WpfInputBaseBrush}" />
        <Setter Property="SelectionBackground" Value="{StaticResource WpfInputSelectedBackgroundBrush}" />
        <Setter Property="SelectionForeground" Value="{StaticResource WpfInputSelectedForegroundBrush}" />
		<Setter Property="Background" Value="{StaticResource InputBackgroundBrush}" />
		<Setter Property="BorderThickness" Value="{StaticResource GeneralThickness}" />
		<Setter Property="Foreground" Value="{StaticResource ForegroundTextBoxBrushColor}" />
		<Setter Property="ButtonForeground" Value="{StaticResource ForegroundBrushColor}" />
        <Setter Property="CornerRadius" Value="{StaticResource GeneralCornerRadius}" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="TextAlignment" Value="Right" />
		<Setter Property="Padding" Value="2" />
		<Setter Property="Interval" Value="33" />
		<Setter Property="Delay" Value="500" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="c1:C1NumericBox">
					<Grid x:Name="Root">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal" />
								<VisualState x:Name="Disabled">
									<Storyboard>
										<DoubleAnimation Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.0" />
									</Storyboard>
								</VisualState>
								<VisualState x:Name="MouseOver">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(UIElement.Visibility)">
											<DiscreteObjectKeyFrame KeyTime="00:00:00">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
							<VisualStateGroup x:Name="FocusStates">
								<VisualState x:Name="Unfocused" />
								<VisualState x:Name="Focused">
									<Storyboard>
										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="FocusedVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
											<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
							<VisualStateGroup x:Name="ButtonsVisibilityStates">
								<VisualState x:Name="HideButtons">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="IncreaseBorder" Storyboard.TargetProperty="(UIElement.Visibility)">
											<DiscreteObjectKeyFrame KeyTime="00:00:00">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Collapsed</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DecreaseBorder" Storyboard.TargetProperty="(UIElement.Visibility)">
											<DiscreteObjectKeyFrame KeyTime="00:00:00">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Collapsed</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="ShowButtons">
									<Storyboard />
								</VisualState>
							</VisualStateGroup>
							<VisualStateGroup x:Name="ValidationStates">
								<VisualState x:Name="Valid" />
								<VisualState x:Name="NumericInvalidUnfocused">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationDecorator" Storyboard.TargetProperty="ValidationState">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<c1:ValidationState>InvalidUnfocused</c1:ValidationState>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="NumericInvalidFocused">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationDecorator" Storyboard.TargetProperty="ValidationState">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<c1:ValidationState>InvalidFocused</c1:ValidationState>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<Grid>
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="*" />
								<ColumnDefinition Width="Auto" />
								<ColumnDefinition x:Name="ButtonsColumn" Width="Auto" />
							</Grid.ColumnDefinitions>
							<Border x:Name="BackgroundElement" Grid.ColumnSpan="3" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" BorderBrush="{TemplateBinding BorderBrush}" />
							
							
							<c1:C1TextBoxBase x:Name="Text" Margin="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=left-top-bottom}" BorderThickness="0" Foreground="{TemplateBinding Foreground}" Background="Transparent" SelectionBackground="{TemplateBinding SelectionBackground}" SelectionForeground="{TemplateBinding SelectionForeground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" TextAlignment="{TemplateBinding TextAlignment}" Watermark="{TemplateBinding Watermark}" FocusCuesVisibility="Collapsed" DisabledCuesVisibility="Collapsed" Padding="{TemplateBinding Padding}" CaretBrush="{TemplateBinding CaretBrush}" IsTabStop="{TemplateBinding IsTabStop}" TabIndex="{TemplateBinding TabIndex}" />
							<Grid Grid.Column="2" Margin="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=top-right-bottom}">
								<Grid.RowDefinitions>
									<RowDefinition />
									<RowDefinition />
								</Grid.RowDefinitions>
								<Border x:Name="IncreaseBorder">
									<RepeatButton x:Name="Increase" Delay="{TemplateBinding Delay}" Interval="{TemplateBinding Interval}" Padding="0" IsTabStop="False" Background="{TemplateBinding ButtonBackground}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{StaticResource ArrowToggleThickness}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}" c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}" c1:ClearStyleExtensions.CornerRadius="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideRadiusConverter}, ConverterParameter='topright'}" Style="{StaticResource ClearStyleButtonStyle}" Width="15">				
										<Polygon Fill="{TemplateBinding ButtonForeground}" Stretch="Uniform" Points="1,0 2,1 0,1" Width="5" Height="5" Margin="0 0 1 1" />
										<!-- Height is required for WPF version -->
									</RepeatButton>
								</Border>
								<Border x:Name="DecreaseBorder" Grid.Row="1" Margin="0,-1,0,0">
									<RepeatButton x:Name="Decrease" Delay="{TemplateBinding Delay}" Interval="{TemplateBinding Interval}" Padding="0" IsTabStop="False" Background="{TemplateBinding ButtonBackground}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{StaticResource ArrowToggleThickness}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}" c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}" c1:ClearStyleExtensions.CornerRadius="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideRadiusConverter}, ConverterParameter='bottomright'}" Style="{StaticResource ClearStyleButtonStyle}" Width="15">
										<Polygon Fill="{TemplateBinding ButtonForeground}" Stretch="Uniform" Points="0,0 2,0 1,1" Width="5" Height="5" Margin="0 0 1 0" />
										<!-- Height is required for WPF version -->
									</RepeatButton>
								</Border>
							</Grid>
							<Border x:Name="FocusedVisualElement" Grid.ColumnSpan="3" BorderBrush="{TemplateBinding FocusBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" Visibility="{TemplateBinding FocusCuesVisibility}" Opacity="0" />
							<Border x:Name="MouseOverElement" Grid.ColumnSpan="3" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" Visibility="Collapsed" />
							<Border x:Name="DisabledVisualElement" Grid.ColumnSpan="3" Background="{StaticResource DisabledBrush}" CornerRadius="{TemplateBinding CornerRadius}" IsHitTestVisible="False" Opacity="0" Visibility="{TemplateBinding DisabledCuesVisibility}" />
						</Grid>

						<c1:C1ValidationDecorator x:Name="ValidationDecorator" Target="{Binding RelativeSource={RelativeSource TemplatedParent}}" Style="{TemplateBinding ValidationDecoratorStyle}" CornerRadius="{TemplateBinding CornerRadius}" />
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>
