math-suite/Source/Help/Styles/SearchTextbox.xaml

43 lines
2.1 KiB
Plaintext
Raw Normal View History

2018-02-05 23:24:46 +00:00
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="SearchBoxStyle" TargetType="{x:Type TextBox}">
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="MinHeight" Value="20" />
<Setter Property="MinWidth" Value="100" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Border Name="border"
Background="White"
BorderBrush="White" BorderThickness="1"
Padding="4,2,4,2">
<Grid>
<TextBlock Name="text" Visibility="Hidden"
VerticalAlignment="Center"
Foreground="Gray"
FontStyle="Italic">Search</TextBlock>
<ScrollViewer VerticalAlignment="Center" x:Name="PART_ContentHost" />
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="Text" Value="">
<Setter TargetName="text" Property="Visibility" Value="Visible" />
</Trigger>
<Trigger Property="IsFocused" Value="True">
<Setter TargetName="text" Property="Visibility" Value="Hidden" />
<Setter TargetName="border" Property="BorderBrush" Value="DodgerBlue" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="BorderBrush" Value="DodgerBlue" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>