<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:com.superscene.ui">


	<Style x:Key="BaseTextBoxLabel" TargetType="{x:Type local:TextBoxLabel}">
		<Setter Property="BorderThickness" Value="0,0,0,1"/>
		<Setter Property="BorderBrush" Value="#a1a1a1"/>

		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type local:TextBoxLabel}">
					<Grid>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="{Binding LeftWidth,RelativeSource={RelativeSource TemplatedParent}}"/>
							<ColumnDefinition Width="*"/>
						</Grid.ColumnDefinitions>
						<Label
							Grid.Column="0"
							Content="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
							Width="{Binding LeftWidth,RelativeSource={RelativeSource TemplatedParent}}"
							Height="{Binding Height,RelativeSource={RelativeSource TemplatedParent}}"
							Foreground="{Binding ContentColor,RelativeSource={RelativeSource TemplatedParent}}"
							HorizontalAlignment="Left"
							Visibility="Visible"
							VerticalContentAlignment="{Binding VerticalContentAlignment,RelativeSource={RelativeSource TemplatedParent}}"
							Padding="{Binding _LabelPadding,RelativeSource={RelativeSource TemplatedParent}}" 
							IsHitTestVisible="False"/>

						<local:TextBoxTip
							Grid.Column="1"
							
							TipColor="{Binding TipColor,RelativeSource={RelativeSource TemplatedParent}}"
							ToolTip="{Binding ToolTip,RelativeSource={RelativeSource TemplatedParent}}"
							Tip="{Binding Tip,RelativeSource={RelativeSource TemplatedParent}}"
							
							Width="{Binding RightWidth,RelativeSource={RelativeSource TemplatedParent}}"
							Height="{Binding Height,RelativeSource={RelativeSource TemplatedParent}}"
							Text="{Binding Text, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
							HorizontalContentAlignment="{Binding HorizontalContentAlignment,RelativeSource={RelativeSource TemplatedParent}}"
							VerticalContentAlignment="{Binding VerticalContentAlignment,RelativeSource={RelativeSource TemplatedParent}}"
							Background="{Binding Background,RelativeSource={RelativeSource TemplatedParent}}"
							Foreground="{Binding Foreground,RelativeSource={RelativeSource TemplatedParent}}"
							CaretBrush="{Binding CaretBrush,RelativeSource={RelativeSource TemplatedParent}}"
							TextWrapping="{Binding TextWrapping,RelativeSource={RelativeSource TemplatedParent}}"
							TextAlignment="{Binding TextAlignment,RelativeSource={RelativeSource TemplatedParent}}" 
							HorizontalScrollBarVisibility="{Binding HorizontalScrollBarVisibility,RelativeSource={RelativeSource TemplatedParent}}"
							VerticalScrollBarVisibility="{Binding VerticalScrollBarVisibility,RelativeSource={RelativeSource TemplatedParent}}"
							MaxLength="{Binding MaxLength,RelativeSource={RelativeSource TemplatedParent}}"
							IsReadOnly="{Binding IsReadOnly,RelativeSource={RelativeSource TemplatedParent}}"
							IsEnabled="{Binding IsEnabled,RelativeSource={RelativeSource TemplatedParent}}"
							BorderThickness="{Binding BorderThickness,RelativeSource={RelativeSource TemplatedParent}}"
							BorderBrush="{Binding BorderBrush,RelativeSource={RelativeSource TemplatedParent}}"/>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>

		<Style.Triggers>
			<!--<Trigger Property="Text" Value="{x:Null}">
				<Setter Property="_ShowTip" Value="Visible"/>
			</Trigger>
			<Trigger Property="Text" Value="">
				<Setter Property="_ShowTip" Value="Visible"/>
			</Trigger>-->
			<Trigger Property="Content" Value="{x:Null}">
				<Setter Property="_LabelPadding" Value="0"/>
			</Trigger>
			<Trigger Property="Content" Value="">
				<Setter Property="_LabelPadding" Value="0"/>
			</Trigger>
		</Style.Triggers>
	</Style>

	<Style BasedOn="{StaticResource BaseTextBoxLabel}" TargetType="{x:Type local:TextBoxLabel}">
		<Setter Property="BorderThickness" Value="0,0,0,1"/>
		<Setter Property="BorderBrush" Value="#a1a1a1"/>
	</Style>

</ResourceDictionary>