	  
	   
    
		

<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">
	<ResourceDictionary.MergedDictionaries>
		<ResourceDictionary Source="/C1.WPF.4;component/themes/Common.xaml" />
	</ResourceDictionary.MergedDictionaries>

	<!--******************** TextEditableContentControl ********************-->
	<Style TargetType="c1:C1TextEditableContentControl">
        
        
        <Setter Property="SelectionBackground" Value="{StaticResource WpfInputSelectedForegroundBrush}" />
        <Setter Property="SelectionForeground" Value="{StaticResource WpfInputSelectedForegroundBrush}" />
        <Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="c1:C1TextEditableContentControl">
					<Grid>
						<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">
								</VisualState>
							</VisualStateGroup>
							<VisualStateGroup x:Name="ValidationStates">
								<VisualState x:Name="Valid" />
								<VisualState x:Name="InvalidUnfocused">
									<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="InvalidFocused">
									<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>
                            <VisualStateGroup x:Name="WatermarkStates">
                                <VisualState x:Name="Unwatermarked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Watermark" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Watermarked" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
						<Border x:Name="border">
							<Grid Margin="{TemplateBinding BorderThickness}">
                                <ContentControl x:Name="Watermark" Opacity="0.65" IsTabStop="False" Content="{TemplateBinding Watermark}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" />
								<ContentPresenter x:Name="ContentControl" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" />
								
								
								<c1:C1TextBoxBase x:Name="EditControl" Padding="{TemplateBinding Padding}" Foreground="{TemplateBinding Foreground}" FocusCuesVisibility="{TemplateBinding FocusCuesVisibility}" BorderThickness="0" Background="{TemplateBinding Background}" VerticalAlignment="{TemplateBinding VerticalAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" TextAlignment="{TemplateBinding TextAlignment}" SelectionBackground="{TemplateBinding SelectionBackground}" SelectionForeground="{TemplateBinding SelectionForeground}" TabIndex="{TemplateBinding TabIndex}" />
							</Grid>
						</Border>
						<Border x:Name="DisabledVisualElement" Background="{StaticResource DisabledBrush}" CornerRadius="{StaticResource GeneralCornerRadius}" IsHitTestVisible="False" Opacity="0" Visibility="{TemplateBinding DisabledCuesVisibility}" />
						<c1:C1ValidationDecorator x:Name="ValidationDecorator" Target="{Binding RelativeSource={RelativeSource TemplatedParent}}" Style="{TemplateBinding ValidationDecoratorStyle}" />
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

</ResourceDictionary>
