<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
		xmlns:telerikChromes="clr-namespace:Telerik.Windows.Controls.Chromes;assembly=Telerik.Windows.Controls"
		xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
        xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
        xmlns:sys="clr-namespace:System;assembly=mscorlib">

    <SolidColorBrush x:Key="ButtonIconBackground_Normal" Color="Transparent" />
<SolidColorBrush x:Key="ButtonIconForeground_Normal" Color="#FF353535" />
<ControlTemplate x:Key="ArrowTemplate_Up" TargetType="ContentControl">
		<Grid>
			<Path x:Name="ForegroundIcon" Data="M0,1 L1,0 2,1 Z" Stretch="Fill" Width="7" Height="4" Fill="{TemplateBinding Foreground}" Margin="5 1 6 0" />
		</Grid>
	</ControlTemplate>
<SolidColorBrush x:Key="ButtonIconForeground_MouseOver" Color="#FF353535" />
<SolidColorBrush x:Key="ButtonIconBackground_MouseOver" Color="Transparent" />
<SolidColorBrush x:Key="ButtonIconForeground_Pressed" Color="#FF353535" />
<SolidColorBrush x:Key="ButtonIconBackground_Pressed" Color="Transparent" />
<SolidColorBrush x:Key="ButtonIconForeground_Disabled" Color="#FF353535" />
<SolidColorBrush x:Key="ButtonIconBackground_Disabled" Color="Transparent" />
<ControlTemplate x:Key="ArrowTemplate_Down" TargetType="ContentControl">
		<Grid>			
			<Path x:Name="ForegroundIcon" Data="M0,0 L2,0 1,1 Z" Stretch="Fill" Width="7" Height="4" Fill="{TemplateBinding Foreground}" Margin="5 0 6 1" />
		</Grid>
	</ControlTemplate>
<SolidColorBrush x:Key="PickerBackground_Normal" Color="#FFFFFFFF" />
<CornerRadius x:Key="SplitButton_LeftPartCornerRadius">2 0 0 2</CornerRadius>
<CornerRadius x:Key="SplitButton_SpanCornerRadius">2</CornerRadius>
<SolidColorBrush x:Key="ControlOuterBorder_MouseOver" Color="#FF6F9DB5" />
<telerik:SummerTheme x:Key="Theme" />
<SolidColorBrush x:Key="ControlOuterBorder_Focused" Color="#FF00B1F0" />
<SolidColorBrush x:Key="ControlInnerBorder_Focused" Color="Transparent" />
<CornerRadius x:Key="SplitButton_SpanInnerCornerRadius">1</CornerRadius>
<CornerRadius x:Key="SplitButton_TopRightPartCornerRadius">0 2 0 0</CornerRadius>
<CornerRadius x:Key="SplitButton_BottomRightPartCornerRadius">0 0 2 0</CornerRadius>
<SolidColorBrush x:Key="ControlOuterBorder_Disabled" Color="#FFC9C9C9" />
<SolidColorBrush x:Key="PickerForeground_Disabled" Color="#FF8D8D8D" />
<LinearGradientBrush x:Key="ControlBackground_Disabled" EndPoint="0.5,1" StartPoint="0.5,0">
		<GradientStop Color="#FFE3E8EB" Offset="1" />
		<GradientStop Color="White" />
	</LinearGradientBrush>
<CornerRadius x:Key="SplitButton_TopPartCornerRadius">2 2 0 0</CornerRadius>
<CornerRadius x:Key="SplitButton_BottomPartCornerRadius">0 0 2 2</CornerRadius>
<SolidColorBrush x:Key="ControlOuterBorder_Normal" Color="#FFB2B2B2" />
<SolidColorBrush x:Key="PickerForeground_Normal" Color="#FF000000" />

    
	
	<Style x:Key="IncreaseButtonStyle" TargetType="RepeatButton">
		<Setter Property="Background" Value="{StaticResource ButtonIconBackground_Normal}" />
		<Setter Property="Foreground" Value="{StaticResource ButtonIconForeground_Normal}" />
		<Setter Property="MinWidth" Value="15" />
		
		<Setter Property="FocusVisualStyle" Value="{x:Null}" />
		
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="RepeatButton">
					<Grid>
						
						<ContentPresenter />
						<ContentControl x:Name="Arrow" Template="{StaticResource ArrowTemplate_Up}" Foreground="{TemplateBinding Foreground}"
										Background="{TemplateBinding Background}" IsTabStop="False"/>
					</Grid>
					
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter TargetName="Arrow" Property="Foreground" Value="{StaticResource ButtonIconForeground_MouseOver}" />
							<Setter TargetName="Arrow" Property="Background" Value="{StaticResource ButtonIconBackground_MouseOver}" />
						</Trigger>
						<Trigger Property="IsPressed" Value="True">
							<Setter TargetName="Arrow" Property="Foreground" Value="{StaticResource ButtonIconForeground_Pressed}" />
							<Setter TargetName="Arrow" Property="Background" Value="{StaticResource ButtonIconBackground_Pressed}" />
						</Trigger>
						<Trigger Property="IsEnabled" Value="False">
							<Setter TargetName="Arrow" Property="Foreground" Value="{StaticResource ButtonIconForeground_Disabled}" />
							<Setter TargetName="Arrow" Property="Background" Value="{StaticResource ButtonIconBackground_Disabled}" />
						</Trigger>
					</ControlTemplate.Triggers>
					
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<Style x:Key="DecreaseButtonStyle" TargetType="RepeatButton">
		<Setter Property="Background" Value="{StaticResource ButtonIconBackground_Normal}" />
		<Setter Property="Foreground" Value="{StaticResource ButtonIconForeground_Normal}" />
		<Setter Property="MinWidth" Value="15" />
		
		<Setter Property="FocusVisualStyle" Value="{x:Null}" />
		
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="RepeatButton">
					<Grid>
						
						<ContentPresenter />
						<ContentControl x:Name="Arrow" Template="{StaticResource ArrowTemplate_Down}" Foreground="{TemplateBinding Foreground}"
										Background="{TemplateBinding Background}" IsTabStop="False" />
					</Grid>
					
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter TargetName="Arrow" Property="Foreground" Value="{StaticResource ButtonIconForeground_MouseOver}" />
							<Setter TargetName="Arrow" Property="Background" Value="{StaticResource ButtonIconBackground_MouseOver}" />
						</Trigger>
						<Trigger Property="IsPressed" Value="True">
							<Setter TargetName="Arrow" Property="Foreground" Value="{StaticResource ButtonIconForeground_Pressed}" />
							<Setter TargetName="Arrow" Property="Background" Value="{StaticResource ButtonIconBackground_Pressed}" />
						</Trigger>
						<Trigger Property="IsEnabled" Value="False">
							<Setter TargetName="Arrow" Property="Foreground" Value="{StaticResource ButtonIconForeground_Disabled}" />
							<Setter TargetName="Arrow" Property="Background" Value="{StaticResource ButtonIconBackground_Disabled}" />
						</Trigger>
					</ControlTemplate.Triggers>
					
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<ControlTemplate x:Key="RadNumericUpDownTemplate" TargetType="telerikInput:RadNumericUpDown">
		<Grid x:Name="LayoutRoot">
			
			<Grid.RowDefinitions>
				<RowDefinition Height="*" />
				<RowDefinition Height="*" />
			</Grid.RowDefinitions>
			<Grid.ColumnDefinitions>
				<ColumnDefinition x:Name="colDefText" Width="*" />
				<ColumnDefinition x:Name="colDefButtons" Width="Auto" />
			</Grid.ColumnDefinitions>

            <Border x:Name="Background" Grid.RowSpan="2" Grid.Column="0"
                    Background="{StaticResource PickerBackground_Normal}"
				    CornerRadius="{StaticResource SplitButton_LeftPartCornerRadius}" />

            <Border Grid.RowSpan="2" Grid.ColumnSpan="2"
                    Background="{TemplateBinding Background}"
                    CornerRadius="{StaticResource SplitButton_SpanCornerRadius}" />
            
			<Border x:Name="Border" Grid.RowSpan="2" Grid.ColumnSpan="2" CornerRadius="{StaticResource SplitButton_SpanCornerRadius}"
					BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" />

			<Border x:Name="MouseOverVisual" Grid.RowSpan="2" Grid.ColumnSpan="2" CornerRadius="{StaticResource SplitButton_SpanCornerRadius}"
					BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{StaticResource ControlOuterBorder_MouseOver}"
					IsHitTestVisible="False" Opacity="0" Visibility="Collapsed" />
								
			<telerik:PickerTextBox x:Name="textbox"
					Grid.Row="0" Grid.RowSpan="2" Grid.Column="0"
					telerik:StyleManager.Theme="{StaticResource Theme}"
					BorderThickness="{TemplateBinding BorderThickness}"
					Padding="{TemplateBinding Padding}"
					HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
					VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>

			<Border x:Name="FocusVisual" Visibility="Collapsed" Grid.RowSpan="2" Grid.ColumnSpan="2" BorderBrush="{StaticResource ControlOuterBorder_Focused}" CornerRadius="{StaticResource SplitButton_SpanCornerRadius}" BorderThickness="{TemplateBinding BorderThickness}">
				<Border BorderBrush="{StaticResource ControlInnerBorder_Focused}" CornerRadius="{StaticResource SplitButton_SpanInnerCornerRadius}" BorderThickness="{TemplateBinding BorderThickness}" />
			</Border>

			<RepeatButton x:Name="increase" Grid.Row="0" Grid.Column="1" Style="{StaticResource IncreaseButtonStyle}" IsTabStop="{TemplateBinding AreButtonsTabStops}">
				<telerikChromes:ButtonChrome x:Name="increaseButtonChrome"
						IsTabStop="False"
						CornerRadius="{StaticResource SplitButton_TopRightPartCornerRadius}"
						telerik:StyleManager.Theme="{StaticResource Theme}"
						BorderBrush="{TemplateBinding BorderBrush}"
						RenderFocused="{Binding IsFocused, ElementName=increase}"
						RenderMouseOver="{Binding IsMouseOver, ElementName=increase}"
						RenderPressed="{Binding IsPressed, ElementName=increase}"
						RenderEnabled="{Binding IsEnabled, ElementName=increase}"
						
						RenderActive="{TemplateBinding IsMouseOver}"
						 />
			</RepeatButton>
			<RepeatButton x:Name="decrease" Grid.Row="1" Grid.Column="1" Style="{StaticResource DecreaseButtonStyle}" IsTabStop="{TemplateBinding AreButtonsTabStops}">
				<telerikChromes:ButtonChrome x:Name="decreaseButtonChrome"
						IsTabStop="False"
						CornerRadius="{StaticResource SplitButton_BottomRightPartCornerRadius}"
						telerik:StyleManager.Theme="{StaticResource Theme}"
						BorderBrush="{TemplateBinding BorderBrush}"
						RenderFocused="{Binding IsFocused, ElementName=decrease}"
						RenderMouseOver="{Binding IsMouseOver, ElementName=decrease}"
						RenderPressed="{Binding IsPressed, ElementName=decrease}"
						RenderEnabled="{Binding IsEnabled, ElementName=decrease}"
						
						RenderActive="{TemplateBinding IsMouseOver}"
						 />
			</RepeatButton>
			
		</Grid>
		
		<ControlTemplate.Triggers>

            <Trigger Property="ShowTextBox" Value="False">
                <Setter TargetName="Background" Property="Visibility" Value="Collapsed" />
            </Trigger>
            <Trigger Property="ShowButtons" Value="False">
                <Setter TargetName="Background" Property="CornerRadius" Value="{StaticResource SplitButton_SpanCornerRadius}" />
            </Trigger>

            <Trigger Property="IsEnabled" Value="False">
				<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource ControlOuterBorder_Disabled}" />
                <Setter TargetName="textbox" Property="Foreground" Value="{StaticResource PickerForeground_Disabled}" />
                <Setter TargetName="Background" Property="Background" Value="{StaticResource ControlBackground_Disabled}" />
            </Trigger>
			<Trigger Property="IsMouseOver" Value="True">
				<Trigger.EnterActions>
					<BeginStoryboard>
						<Storyboard>
							<DoubleAnimationUsingKeyFrames Storyboard.TargetName="MouseOverVisual" Storyboard.TargetProperty="Opacity">
								<LinearDoubleKeyFrame KeyTime="0:0:0.115" Value="1" />
							</DoubleAnimationUsingKeyFrames>
							<ObjectAnimationUsingKeyFrames Storyboard.TargetName="MouseOverVisual" Storyboard.TargetProperty="Visibility">
								<DiscreteObjectKeyFrame KeyTime="0:0:0">
									<DiscreteObjectKeyFrame.Value>
										<Visibility>Visible</Visibility>
									</DiscreteObjectKeyFrame.Value>
								</DiscreteObjectKeyFrame>
							</ObjectAnimationUsingKeyFrames>
						</Storyboard>
					</BeginStoryboard>
				</Trigger.EnterActions>
				<Trigger.ExitActions>
					<BeginStoryboard>
						<Storyboard>
							<DoubleAnimationUsingKeyFrames Storyboard.TargetName="MouseOverVisual" Storyboard.TargetProperty="Opacity">
								<LinearDoubleKeyFrame KeyTime="0:0:0.150" Value="0" />
							</DoubleAnimationUsingKeyFrames>
							<ObjectAnimationUsingKeyFrames Storyboard.TargetName="MouseOverVisual" Storyboard.TargetProperty="Visibility">
								<DiscreteObjectKeyFrame KeyTime="0:0:0.150">
									<DiscreteObjectKeyFrame.Value>
										<Visibility>Collapsed</Visibility>
									</DiscreteObjectKeyFrame.Value>
								</DiscreteObjectKeyFrame>
							</ObjectAnimationUsingKeyFrames>
						</Storyboard>
					</BeginStoryboard>
				</Trigger.ExitActions>
			</Trigger>
			<Trigger Property="IsKeyboardFocusWithin" Value="True">
				<Setter TargetName="FocusVisual" Property="Visibility" Value="Visible" />
			</Trigger>
			<MultiTrigger>
				<MultiTrigger.Conditions>
					<Condition Property="ShowTextBox" Value="True" />
					<Condition Property="IsKeyboardFocusWithin" Value="True" />
				</MultiTrigger.Conditions>
				<Setter TargetName="decreaseButtonChrome" Property="RenderFocused" Value="True" />
				<Setter TargetName="increaseButtonChrome" Property="RenderFocused" Value="True" />
			</MultiTrigger>
			<Trigger Property="ShowTextBox" Value="False">
				<Setter TargetName="textbox" Property="Visibility" Value="Collapsed" />
				<Setter TargetName="colDefText" Property="Width" Value="auto" />
				<Setter TargetName="colDefButtons" Property="Width" Value="*" />
				<Setter TargetName="decreaseButtonChrome" Property="RenderActive" Value="False" />
				<Setter TargetName="increaseButtonChrome" Property="RenderActive" Value="False" />
				<Setter TargetName="increaseButtonChrome" Property="CornerRadius" Value="{StaticResource SplitButton_TopPartCornerRadius}"  />
				<Setter TargetName="decreaseButtonChrome" Property="CornerRadius" Value="{StaticResource SplitButton_BottomPartCornerRadius}" />
			</Trigger>
			<Trigger Property="ShowButtons" Value="False">
				<Setter TargetName="increase" Property="Visibility" Value="Collapsed" />
				<Setter TargetName="decrease" Property="Visibility" Value="Collapsed" />
			</Trigger>
		</ControlTemplate.Triggers>
		
	</ControlTemplate>

	<Style TargetType="telerikInput:RadNumericUpDown" x:Key="{telerik:ThemeResourceKey ThemeType=telerik:SummerTheme , ElementType=telerikInput:RadNumericUpDown}" >
		<Setter Property="Template" Value="{StaticResource RadNumericUpDownTemplate}" />
		<Setter Property="MinHeight" Value="22" />
		<Setter Property="MinWidth" Value="60" />
		<Setter Property="Padding" Value="4 0" />
		<Setter Property="BorderThickness" Value="1" />
		<Setter Property="BorderBrush" Value="{StaticResource ControlOuterBorder_Normal}" />
		<Setter Property="Foreground" Value="{StaticResource PickerForeground_Normal}" />
		<Setter Property="Background" Value="Transparent" />
		<Setter Property="HorizontalContentAlignment" Value="Right" />
		<Setter Property="VerticalContentAlignment" Value="Center" />
		<Setter Property="IsTabStop" Value="false" />
		
		<Setter Property="SnapsToDevicePixels" Value="True" />
		
	</Style>

	
</ResourceDictionary>