	  
	   
    
		

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:system="clr-namespace:System;assembly=mscorlib" xmlns:c1="clr-namespace:C1.WPF">
	<ResourceDictionary.MergedDictionaries>
		<ResourceDictionary Source="/C1.WPF.4;component/themes/Common.xaml" />
	</ResourceDictionary.MergedDictionaries>

	<!--******************** C1ValidationDecorator *********************-->

	<Style x:Key="ValidationToolTipStyle" TargetType="ToolTip">
        <Setter Property="Background" Value="{StaticResource ValidationBaseColorBrush}" />
        <Setter Property="Foreground" Value="{StaticResource ValidationForegroundBrush}" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="ToolTip">
					
					<Grid x:Name="Root" Margin="5 0">
						<Border Background="{TemplateBinding Background}" CornerRadius="2">
							<ContentPresenter x:Name="Content" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" />
						</Border>
					</Grid>
					
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- C1ValidationDecorator Style-->
	<Style TargetType="c1:C1ValidationDecorator">
        <Setter Property="Background" Value="{StaticResource ValidationBaseColorBrush}" />
        <Setter Property="Foreground" Value="{StaticResource ValidationForegroundBrush}" />
		<Setter Property="CornerRadius" Value="1" />
		<Setter Property="BorderThickness" Value="1" />
		<Setter Property="IsTabStop" Value="False" />
		<Setter Property="IsHitTestVisible" Value="False" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="c1:C1ValidationDecorator">
					<Border x:Name="ValidationErrorElement" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" BorderBrush="{TemplateBinding Background}" Visibility="Collapsed">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="ValidationStates">
								<VisualState x:Name="Valid" />
								<VisualState x:Name="InvalidUnfocused">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="InvalidFocused">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<system:Boolean>True</system:Boolean>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<ToolTipService.ToolTip>
							<ToolTip x:Name="validationTooltip" Background="{TemplateBinding Background}" Foreground="{TemplateBinding Foreground}" Placement="Right" PlacementTarget="{TemplateBinding Target}" Style="{StaticResource ValidationToolTipStyle}" Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Target.(Validation.Errors)}">
								<ToolTip.ContentTemplate>
									<DataTemplate>
										<TextBlock Margin="8 4" MaxWidth="250" VerticalAlignment="Center" Text="{Binding Path=[0].ErrorContent}" TextWrapping="Wrap" />
									</DataTemplate>
								</ToolTip.ContentTemplate>
								
							</ToolTip>
						</ToolTipService.ToolTip>
						<Path Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z" Fill="{TemplateBinding Background}" Margin="0 -1 -1 0" HorizontalAlignment="Right" VerticalAlignment="Top" />
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>
