Skip to content

Commit 2b89c4e

Browse files
committed
Code Quality: Bound event to local function
1 parent 4b58838 commit 2b89c4e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Files.App/UserControls/SearchBox.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
<AutoSuggestBox
7777
x:Name="SearchRegion"
7878
BorderBrush="{ThemeResource ControlElevationBorderBrush}"
79-
GotFocus="{x:Bind SearchBoxViewModel.SearchRegion_GotFocus}"
79+
GotFocus="SearchRegion_GotFocus"
8080
ItemTemplate="{StaticResource SuggestionTemplate}"
8181
ItemsSource="{x:Bind SearchBoxViewModel.Suggestions, Mode=OneWay}"
8282
KeyDown="SearchRegion_KeyDown"

src/Files.App/UserControls/SearchBox.xaml.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) Files Community
22
// Licensed under the MIT License.
33

4-
using Files.App.ViewModels;
54
using Microsoft.UI.Xaml;
65
using Microsoft.UI.Xaml.Controls;
76
using Microsoft.UI.Xaml.Input;
@@ -21,6 +20,9 @@ public SearchBoxViewModel SearchBoxViewModel
2120

2221
public SearchBox() => InitializeComponent();
2322

23+
private void SearchRegion_GotFocus(object sender, RoutedEventArgs e)
24+
=> SearchBoxViewModel.SearchRegion_GotFocus(sender, e);
25+
2426
private void SearchRegion_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs e)
2527
=> SearchBoxViewModel.SearchRegion_TextChanged(sender, e);
2628

0 commit comments

Comments
 (0)