Added source code.
This commit is contained in:
43
Source/Help/Styles/SearchTextbox.xaml
Normal file
43
Source/Help/Styles/SearchTextbox.xaml
Normal file
@ -0,0 +1,43 @@
|
||||
<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>
|
Reference in New Issue
Block a user