-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSearchVisualStudioCommandsWPF.xaml
More file actions
102 lines (98 loc) · 5.3 KB
/
SearchVisualStudioCommandsWPF.xaml
File metadata and controls
102 lines (98 loc) · 5.3 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<Window x:Class="NaturalCommands.SearchVisualStudioCommandsWPF"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:NaturalCommands"
mc:Ignorable="d"
Title="Search Visual Studio Commands" Height="600" Width="800" Icon="{DynamicResource SearchIcon}"
FocusManager.FocusedElement="{Binding ElementName=SearchBox}">
<Window.Resources>
<!-- Search icon (vector) used as window icon. Keeps the project free of binary .ico files. -->
<Pen x:Key="SearchIconPen" Brush="Black" Thickness="1.6"/>
<DrawingImage x:Key="SearchIcon" >
<DrawingImage.Drawing>
<DrawingGroup>
<!-- Circle -->
<GeometryDrawing Brush="Transparent" Pen="{StaticResource SearchIconPen}">
<GeometryDrawing.Geometry>
<EllipseGeometry Center="8,8" RadiusX="6" RadiusY="6" />
</GeometryDrawing.Geometry>
</GeometryDrawing>
<!-- Handle -->
<GeometryDrawing Brush="Transparent" Pen="{StaticResource SearchIconPen}">
<GeometryDrawing.Geometry>
<PathGeometry Figures="M12,12 L18,18" />
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
<Style TargetType="Button">
<Setter Property="Padding" Value="10,5"/>
<Setter Property="Margin" Value="5"/>
</Style>
</Window.Resources>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Search Box -->
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,0,0,10">
<Label Content="_Search:" Target="{Binding ElementName=SearchBox}" VerticalAlignment="Center"/>
<TextBox x:Name="SearchBox" Width="400" Margin="5,0,0,0" VerticalAlignment="Center" TextChanged="SearchBox_TextChanged"/>
</StackPanel>
<!-- Results List -->
<ListView x:Name="ResultsList" Grid.Row="1" SelectionMode="Single">
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel Margin="5">
<TextBlock Text="{Binding Name}" FontWeight="Bold" FontSize="14"/>
<StackPanel Orientation="Horizontal" Margin="0,2,0,0">
<TextBlock Text="Say: " Foreground="Gray"/>
<TextBlock Text="{Binding NaturalLanguageExample}" FontStyle="Italic"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,2,0,0" Visibility="{Binding HasBindings, Converter={StaticResource BooleanToVisibilityConverter}}">
<TextBlock Text="Shortcuts: " Foreground="Gray"/>
<TextBlock Text="{Binding BindingsDisplay}" Foreground="DarkBlue"/>
</StackPanel>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
<ListView.GroupStyle>
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True" Margin="0,4,0,4">
<Expander.Header>
<TextBlock Text="{Binding Name}" FontWeight="Bold" Background="LightGray" Padding="5"/>
</Expander.Header>
<ItemsPresenter/>
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</ListView.GroupStyle>
</ListView>
<!-- Buttons -->
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,0,0">
<Button Content="_Copy Command" Click="CopyCommand_Click"/>
<Button Content="_Open File Location" Click="OpenFileLocation_Click"/>
</StackPanel>
<!-- Instructions -->
<TextBlock Grid.Row="3" Margin="0,10,0,0" TextWrapping="Wrap" Foreground="Gray" FontSize="11">
To refresh the commands file, run the following command in the terminal:<LineBreak/>
ExecuteCommands.exe export-vs-commands
</TextBlock>
</Grid>
</Window>