/
FilterText.xaml
43 lines (38 loc) · 2.05 KB
/
FilterText.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<UserControl x:Class="IronNails.Controls.FilterText"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="300" Width="300">
<UserControl.Resources>
<!-- border style -->
<Style x:Key="BorderStyle" TargetType="{x:Type Border}">
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="3" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" />
</Style>
<!-- textbox style -->
<Style x:Key="TextStyle" TargetType="{x:Type TextBox}">
<Setter Property="Margin" Value="2,1,2,2" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="BorderBrush" Value="{x:Null}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<!-- reset button style -->
<Style x:Key="ButtonStyle" TargetType="{x:Type Button}">
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" />
<Setter Property="Width" Value="20" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="BorderBrush" Value="{x:Null}" />
<Setter Property="BorderThickness" Value="0" />
</Style>
</UserControl.Resources>
<!-- filter control -->
<Border Style="{StaticResource BorderStyle}">
<DockPanel Height="23">
<Button x:Name="FilterButton" DockPanel.Dock="Right" Content="X" Click="FilterButton_Click" Width="21" Height="21" ToolTip="Clear Filter Text" />
<TextBox x:Name="FilterTextBox" DockPanel.Dock="Left" Style="{StaticResource TextStyle}" TextChanged="FilterTextBox_TextChanged" />
</DockPanel>
</Border>
</UserControl>