|
| 1 | +<UserControl |
| 2 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 4 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 5 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 6 | + xmlns:local="clr-namespace:UnityLauncherPro" |
| 7 | + mc:Ignorable="d" x:Class="UnityLauncherPro.Controls.SearchBoxControl" |
| 8 | + Height="20" Width="222" Background="{DynamicResource ThemeTextBoxBackground}"> |
| 9 | + <Grid> |
| 10 | + <!-- Placeholder text --> |
| 11 | + <TextBlock Margin="3,2" MinWidth="100" Text="Search" Foreground="{DynamicResource ThemeSearchPlaceholder}" Height="24"> |
| 12 | + <TextBlock.Style> |
| 13 | + <Style TargetType="TextBlock"> |
| 14 | + <Setter Property="Visibility" Value="Collapsed" /> |
| 15 | + <Style.Triggers> |
| 16 | + <DataTrigger Binding="{Binding Text, ElementName=txtSearchBox}" Value=""> |
| 17 | + <Setter Property="Visibility" Value="Visible" /> |
| 18 | + </DataTrigger> |
| 19 | + </Style.Triggers> |
| 20 | + </Style> |
| 21 | + </TextBlock.Style> |
| 22 | + </TextBlock> |
| 23 | + |
| 24 | + <!-- Search TextBox --> |
| 25 | + <TextBox MinWidth="100" CaretBrush="{DynamicResource ThemeSearchCaret}" x:Name="txtSearchBox" Background="Transparent" BorderBrush="{x:Null}" Foreground="{DynamicResource ThemeSearchForeground}" SelectionBrush="{DynamicResource ThemeSearchSelection}" BorderThickness="0" Margin="2,2,0,0" UndoLimit="64" PreviewKeyDown="TxtSearchBox_PreviewKeyDown" TextChanged="TxtSearchBox_TextChanged" /> |
| 26 | + |
| 27 | + <!-- Clear button --> |
| 28 | + <Button x:Name="btnClearSearch" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" BorderThickness="0" HorizontalAlignment="Right" VerticalAlignment="Top" Height="23" Width="23" Background="Transparent" Padding="0,2" BorderBrush="{x:Null}" Click="OnClearSearchClick" IsTabStop="False"> |
| 29 | + <TextBlock Text="❌" FontSize="8" Foreground="{DynamicResource ThemeSearchClose}" Padding="5,3,4,4" HorizontalAlignment="Center"> |
| 30 | + <TextBlock.Style> |
| 31 | + <Style TargetType="{x:Type TextBlock}"> |
| 32 | + <Style.Triggers> |
| 33 | + <DataTrigger Binding="{Binding Text, ElementName=txtSearchBox}" Value=""> |
| 34 | + <Setter Property="Visibility" Value="Hidden"/> |
| 35 | + </DataTrigger> |
| 36 | + <DataTrigger Binding="{Binding Text, ElementName=txtSearchBox}" Value="{x:Null}"> |
| 37 | + <Setter Property="Visibility" Value="Hidden"/> |
| 38 | + </DataTrigger> |
| 39 | + </Style.Triggers> |
| 40 | + </Style> |
| 41 | + </TextBlock.Style> |
| 42 | + </TextBlock> |
| 43 | + </Button> |
| 44 | + </Grid> |
| 45 | +</UserControl> |
0 commit comments