anshdadhich commited on
Commit
8a66d96
·
verified ·
1 Parent(s): 49c120e

Upload FastSeekWpf/MainWindow.xaml

Browse files
Files changed (1) hide show
  1. FastSeekWpf/MainWindow.xaml +129 -0
FastSeekWpf/MainWindow.xaml ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <Window x:Class="FastSeekWpf.MainWindow"
2
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
+ xmlns:local="clr-namespace:FastSeekWpf"
5
+ Title="FastSeek"
6
+ Name="FastSeekWnd"
7
+ Width="720"
8
+ MinHeight="74"
9
+ MaxHeight="600"
10
+ WindowStyle="None"
11
+ AllowsTransparency="False"
12
+ Background="Transparent"
13
+ ShowInTaskbar="False"
14
+ Topmost="True"
15
+ ResizeMode="NoResize"
16
+ SizeToContent="Height"
17
+ WindowStartupLocation="Manual"
18
+ Loaded="Window_Loaded"
19
+ Deactivated="Window_Deactivated"
20
+ KeyDown="Window_KeyDown">
21
+
22
+ <Window.Resources>
23
+ <SolidColorBrush x:Key="AccentBrush" Color="#64A5FF"/>
24
+ <SolidColorBrush x:Key="TextBrush" Color="#E6EBFA"/>
25
+ <SolidColorBrush x:Key="TextDimBrush" Color="#7882A5"/>
26
+ <SolidColorBrush x:Key="HoverBrush" Color="#FFFFFF" Opacity="0.06"/>
27
+ <SolidColorBrush x:Key="SelectedBrush" Color="#FFFFFF" Opacity="0.10"/>
28
+
29
+ <local:KindToBadgeConverter x:Key="KindToBadge"/>
30
+ <local:PathShortenerConverter x:Key="PathShortener"/>
31
+ <BooleanToVisibilityConverter x:Key="BoolToVis"/>
32
+
33
+ <Style x:Key="SearchBoxStyle" TargetType="TextBox">
34
+ <Setter Property="Background" Value="Transparent"/>
35
+ <Setter Property="Foreground" Value="{StaticResource TextBrush}"/>
36
+ <Setter Property="BorderThickness" Value="0"/>
37
+ <Setter Property="FontSize" Value="20"/>
38
+ <Setter Property="FontFamily" Value="Segoe UI Variable Display, Segoe UI, sans-serif"/>
39
+ <Setter Property="VerticalContentAlignment" Value="Center"/>
40
+ <Setter Property="Padding" Value="48,0,16,0"/>
41
+ <Setter Property="CaretBrush" Value="{StaticResource AccentBrush}"/>
42
+ <Setter Property="SelectionBrush" Value="{StaticResource AccentBrush}"/>
43
+ </Style>
44
+
45
+ <DataTemplate x:Key="ResultItemTemplate" DataType="local:ResultItem">
46
+ <Border Height="56" Background="Transparent" x:Name="RowBorder" Cursor="Hand"
47
+ MouseEnter="ResultItem_MouseEnter"
48
+ MouseLeftButtonDown="ResultItem_Click"
49
+ MouseLeftButtonUp="ResultItem_Up">
50
+ <Grid>
51
+ <Grid.ColumnDefinitions>
52
+ <ColumnDefinition Width="52"/>
53
+ <ColumnDefinition Width="*"/>
54
+ <ColumnDefinition Width="Auto"/>
55
+ <ColumnDefinition Width="12"/>
56
+ </Grid.ColumnDefinitions>
57
+ <TextBlock Grid.Column="0" Text="{Binding IconGlyph}" FontFamily="Segoe MDL2 Assets" FontSize="20"
58
+ Foreground="{StaticResource AccentBrush}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
59
+ <StackPanel Grid.Column="1" VerticalAlignment="Center" Margin="4,0,0,0">
60
+ <TextBlock Text="{Binding DisplayName}" FontSize="14" FontWeight="SemiBold"
61
+ Foreground="{StaticResource TextBrush}" TextTrimming="CharacterEllipsis"/>
62
+ <TextBlock Text="{Binding FullPath, Converter={StaticResource PathShortener}}"
63
+ FontSize="11" Foreground="{StaticResource TextDimBrush}"
64
+ TextTrimming="CharacterEllipsis"/>
65
+ </StackPanel>
66
+ <Border Grid.Column="2" CornerRadius="3.5" Padding="6,1.5" VerticalAlignment="Center" Margin="8,0,0,0"
67
+ Background="{Binding Kind, Converter={StaticResource KindToBadge}}">
68
+ <TextBlock Text="{Binding BadgeLabel}" FontSize="9" FontWeight="Bold"
69
+ Foreground="White"/>
70
+ </Border>
71
+ </Grid>
72
+ </Border>
73
+ <DataTemplate.Triggers>
74
+ <DataTrigger Binding="{Binding IsSelected}" Value="True">
75
+ <Setter TargetName="RowBorder" Property="Background" Value="{StaticResource SelectedBrush}"/>
76
+ </DataTrigger>
77
+ <DataTrigger Binding="{Binding IsHovered}" Value="True">
78
+ <Setter TargetName="RowBorder" Property="Background" Value="{StaticResource HoverBrush}"/>
79
+ </DataTrigger>
80
+ </DataTemplate.Triggers>
81
+ </DataTemplate>
82
+ </Window.Resources>
83
+
84
+ <Border Background="#FF0E1018" CornerRadius="12" x:Name="WindowBorder" BorderThickness="1"
85
+ BorderBrush="#FF2A2D3A" SnapsToDevicePixels="True">
86
+ <Border.Effect>
87
+ <DropShadowEffect BlurRadius="24" ShadowDepth="4" Direction="270" Opacity="0.4" Color="Black"/>
88
+ </Border.Effect>
89
+
90
+ <Grid>
91
+ <Grid.RowDefinitions>
92
+ <RowDefinition Height="Auto"/>
93
+ <RowDefinition Height="Auto"/>
94
+ <RowDefinition Height="*"/>
95
+ <RowDefinition Height="Auto"/>
96
+ </Grid.RowDefinitions>
97
+
98
+ <!-- Search Bar -->
99
+ <Grid Grid.Row="0" Height="62">
100
+ <Grid.ColumnDefinitions>
101
+ <ColumnDefinition Width="Auto"/>
102
+ <ColumnDefinition Width="*"/>
103
+ </Grid.ColumnDefinitions>
104
+ <TextBlock Grid.Column="0" Text="&#xE721;" FontFamily="Segoe MDL2 Assets" FontSize="18"
105
+ Foreground="{StaticResource AccentBrush}" Margin="20,0,0,0" VerticalAlignment="Center"/>
106
+ <TextBox Grid.Column="1" x:Name="SearchBox" Style="{StaticResource SearchBoxStyle}"
107
+ TextChanged="SearchBox_TextChanged" Loaded="SearchBox_Loaded"/>
108
+ </Grid>
109
+
110
+ <Rectangle Grid.Row="1" Height="1" Fill="White" Opacity="0.05" x:Name="SepLine"
111
+ Visibility="Collapsed"/>
112
+
113
+ <ItemsControl Grid.Row="2" x:Name="ResultsList" ItemsSource="{Binding Results, RelativeSource={RelativeSource AncestorType=Window}}"
114
+ ItemTemplate="{StaticResource ResultItemTemplate}"
115
+ Visibility="Collapsed">
116
+ <ItemsControl.ItemsPanel>
117
+ <ItemsPanelTemplate>
118
+ <VirtualizingStackPanel IsItemsHost="True"/>
119
+ </ItemsPanelTemplate>
120
+ </ItemsControl.ItemsPanel>
121
+ </ItemsControl>
122
+
123
+ <Grid Grid.Row="3" x:Name="StatusBar" Height="28" Background="#FF12141C" Visibility="Collapsed">
124
+ <TextBlock x:Name="StatusText" FontSize="10.5" Foreground="{StaticResource TextDimBrush}"
125
+ VerticalAlignment="Center" Margin="20,0,0,0"/>
126
+ </Grid>
127
+ </Grid>
128
+ </Border>
129
+ </Window>