Skip to content

Commit 37c252e

Browse files
authored
Merge pull request #5214 from glowingrunes/5137-TextBoxClearOnEsc
Added the ClearSearchCommand to the SearchBox ValueContainer.
2 parents 136094b + bed9ac5 commit 37c252e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Rubberduck.Core/UI/Controls/SearchBox.xaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@
2424
Panel.ZIndex="2"
2525
VerticalContentAlignment="Center"
2626
Width="Auto"
27-
Grid.Row="0" Grid.Column="0"/>
27+
Grid.Row="0" Grid.Column="0">
28+
<TextBox.InputBindings>
29+
<KeyBinding Command="{Binding Path=ClearSearchCommand}" Key="Esc"/>
30+
</TextBox.InputBindings>
31+
</TextBox>
2832
<!-- this is the actual hint container, it's BELOW the displaying control -->
2933
<TextBox Text="{Binding Path=Hint, ElementName=Root, Mode=OneWay}"
3034
Background="{Binding Path=Background, ElementName=Root}"
@@ -44,6 +48,11 @@
4448
</Style.Triggers>
4549
</Style>
4650
</TextBox.Style>
51+
<TextBox.InputBindings>
52+
<KeyBinding Key="Esc"
53+
Modifiers="Control"
54+
Command="{Binding ClearSearchCommand}" />
55+
</TextBox.InputBindings>
4756
</TextBox>
4857
<Button Name="SearchButton" Grid.Column="1" Command="{Binding ClearSearchCommand}"
4958
BorderBrush="{x:Static SystemColors.ControlLightBrush}"

0 commit comments

Comments
 (0)