<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="BaseTextBoxTip" TargetType="{x:Type local:TextBoxTip}"  >
		<Setter Property="BorderThickness" Value="0,0,0,1"/>
		<Setter Property="BorderBrush" Value="#a1a1a1"/>

		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type local:TextBoxTip}">
					<Grid>
						<TextBox
							BorderThickness="{Binding BorderThickness,RelativeSource={RelativeSource TemplatedParent}}"
							BorderBrush="{Binding BorderBrush,RelativeSource={RelativeSource TemplatedParent}}"
							CaretBrush="{Binding CaretBrush,RelativeSource={RelativeSource TemplatedParent}}"
							Width="{Binding Width,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}}"
							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}}"
							Padding="0,0,0,3" 
							>
							<TextBox.Style>
								<Style TargetType="{x:Type TextBox}">
									<Setter Property="Template">
										<Setter.Value>
											<ControlTemplate TargetType="{x:Type TextBox}">
												<Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
													<ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
												</Border>
												<ControlTemplate.Triggers>
													<Trigger Property="IsMouseOver" Value="true">
														<Setter Property="BorderBrush" TargetName="border" Value="{Binding BorderBrush,RelativeSource={RelativeSource TemplatedParent}}"/>
													</Trigger>
													<Trigger Property="IsKeyboardFocused" Value="true">
														<Setter Property="BorderBrush" TargetName="border" Value="{Binding BorderBrush,RelativeSource={RelativeSource TemplatedParent}}"/>
													</Trigger>
												</ControlTemplate.Triggers>
											</ControlTemplate>
										</Setter.Value>
									</Setter>
								</Style>
							</TextBox.Style>
						</TextBox>

						<Label Content="{Binding Tip, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
							Width="{Binding Width,RelativeSource={RelativeSource TemplatedParent}}"
							Height="{Binding Height,RelativeSource={RelativeSource TemplatedParent}}"
							Foreground="{Binding TipColor,RelativeSource={RelativeSource TemplatedParent}}"
							Visibility="{Binding _ShowTip,RelativeSource={RelativeSource TemplatedParent}}"
							VerticalContentAlignment="{Binding VerticalContentAlignment,RelativeSource={RelativeSource TemplatedParent}}"
							Padding="5,0,0,3" 
							IsHitTestVisible="False"/>
					</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>
		</Style.Triggers>
	</Style>

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

</ResourceDictionary>