|
4 | 4 | xmlns:wox="clr-namespace:Wox" |
5 | 5 | xmlns:vm="clr-namespace:Wox.ViewModel" |
6 | 6 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
7 | | - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" |
| 7 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 8 | + xmlns:converters="clr-namespace:Wox.Converters" |
| 9 | + mc:Ignorable="d" |
8 | 10 | Title="Wox" |
9 | 11 | Topmost="True" |
10 | 12 | SizeToContent="Height" |
|
25 | 27 | PreviewKeyDown="OnKeyDown" |
26 | 28 | Visibility="{Binding MainWindowVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" |
27 | 29 | d:DataContext="{d:DesignInstance vm:MainViewModel}"> |
| 30 | + <Window.Resources> |
| 31 | + <converters:QuerySuggestionBoxConverter x:Key="QuerySuggestionBoxConverter"/> |
| 32 | + </Window.Resources> |
28 | 33 | <Window.InputBindings> |
29 | 34 | <KeyBinding Key="Escape" Command="{Binding EscCommand}"></KeyBinding> |
30 | 35 | <KeyBinding Key="F1" Command="{Binding StartHelpCommand}"></KeyBinding> |
|
55 | 60 | </Window.InputBindings> |
56 | 61 | <Border Style="{DynamicResource WindowBorderStyle}" MouseDown="OnMouseDown" > |
57 | 62 | <StackPanel Orientation="Vertical"> |
58 | | - <TextBox Style="{DynamicResource QueryBoxStyle}" |
| 63 | + <Grid> |
| 64 | + <TextBox x:Name="QueryTextSuggestionBox" |
| 65 | + Style="{DynamicResource QueryBoxStyle}" |
| 66 | + Foreground="LightGray" |
| 67 | + IsEnabled="False"> |
| 68 | + <TextBox.Text> |
| 69 | + <MultiBinding Converter="{StaticResource QuerySuggestionBoxConverter}"> |
| 70 | + <Binding ElementName="QueryTextBox" Path="Text"/> |
| 71 | + <Binding ElementName="ResultListBox" Path="SelectedItem"/> |
| 72 | + </MultiBinding> |
| 73 | + </TextBox.Text> |
| 74 | + </TextBox> |
| 75 | + <TextBox x:Name="QueryTextBox" |
| 76 | + Style="{DynamicResource QueryBoxStyle}" |
59 | 77 | Text="{Binding QueryText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" |
60 | 78 | PreviewDragOver="OnPreviewDragOver" |
61 | 79 | TextChanged="OnTextChanged" |
62 | 80 | AllowDrop="True" |
63 | 81 | Visibility="Visible" |
64 | | - x:Name="QueryTextBox"> |
65 | | - <TextBox.ContextMenu> |
66 | | - <ContextMenu> |
67 | | - <MenuItem Command="ApplicationCommands.Cut"/> |
68 | | - <MenuItem Command="ApplicationCommands.Copy"/> |
69 | | - <MenuItem Command="ApplicationCommands.Paste"/> |
70 | | - <Separator /> |
71 | | - <MenuItem Header="Settings" Click="OnContextMenusForSettingsClick" /> |
72 | | - </ContextMenu> |
73 | | - </TextBox.ContextMenu> |
74 | | - </TextBox> |
| 82 | + Background="Transparent"> |
| 83 | + <TextBox.ContextMenu> |
| 84 | + <ContextMenu> |
| 85 | + <MenuItem Command="ApplicationCommands.Cut"/> |
| 86 | + <MenuItem Command="ApplicationCommands.Copy"/> |
| 87 | + <MenuItem Command="ApplicationCommands.Paste"/> |
| 88 | + <Separator /> |
| 89 | + <MenuItem Header="Settings" Click="OnContextMenusForSettingsClick" /> |
| 90 | + </ContextMenu> |
| 91 | + </TextBox.ContextMenu> |
| 92 | + </TextBox> |
| 93 | + </Grid> |
75 | 94 | <Line x:Name="ProgressBar" HorizontalAlignment="Right" |
76 | 95 | Style="{DynamicResource PendingLineStyle}" Visibility="{Binding ProgressBarVisibility, Mode=TwoWay}" |
77 | 96 | Y1="0" Y2="0" X2="100" Height="2" Width="752" StrokeThickness="1"> |
78 | 97 | </Line> |
79 | 98 | <ContentControl> |
80 | | - <wox:ResultListBox DataContext="{Binding Results}" PreviewMouseDown="OnPreviewMouseButtonDown" /> |
| 99 | + <wox:ResultListBox x:Name="ResultListBox" DataContext="{Binding Results}" PreviewMouseDown="OnPreviewMouseButtonDown" /> |
81 | 100 | </ContentControl> |
82 | 101 | <ContentControl> |
83 | 102 | <wox:ResultListBox DataContext="{Binding ContextMenu}" PreviewMouseDown="OnPreviewMouseButtonDown" /> |
|
0 commit comments