Skip to content

Commit e744e0c

Browse files
committed
Fixed "Switching tabs while focused on the Omnibar causes a crash"
1 parent f5e7df5 commit e744e0c

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

src/Files.App/UserControls/NavigationToolbar.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@
321321
x:Name="Omnibar"
322322
Grid.Column="1"
323323
x:Load="{x:Bind ViewModel.EnableOmnibar, Mode=OneWay}"
324-
CurrentSelectedMode="{x:Bind ViewModel.OmnibarCurrentSelectedMode, Mode=TwoWay}"
325324
CurrentSelectedModeName="{x:Bind ViewModel.OmnibarCurrentSelectedModeName, Mode=TwoWay}"
326325
IsFocused="{x:Bind ViewModel.IsOmnibarFocused, Mode=TwoWay}"
327326
LostFocus="Omnibar_LostFocus"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,9 @@ private void BreadcrumbBar_ItemDropDownFlyoutClosed(object sender, BreadcrumbBar
413413

414414
private void Omnibar_LostFocus(object sender, RoutedEventArgs e)
415415
{
416-
if (ViewModel.OmnibarCurrentSelectedMode == OmnibarCommandPaletteMode)
416+
if (Omnibar.CurrentSelectedMode == OmnibarCommandPaletteMode)
417417
{
418-
ViewModel.OmnibarCurrentSelectedMode = OmnibarPathMode;
418+
Omnibar.CurrentSelectedMode = OmnibarPathMode;
419419
ViewModel.OmnibarCommandPaletteModeText = string.Empty;
420420
}
421421
}

src/Files.App/ViewModels/UserControls/NavigationToolbarViewModel.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public bool IsOmnibarFocused
242242

243243
if (value)
244244
{
245-
switch (OmnibarCurrentSelectedMode.Name)
245+
switch (OmnibarCurrentSelectedModeName)
246246
{
247247
case OmnibarPathModeName:
248248
PathText =
@@ -263,10 +263,7 @@ public bool IsOmnibarFocused
263263
}
264264
}
265265

266-
private OmnibarMode _OmnibarCurrentSelectedMode;
267-
public OmnibarMode OmnibarCurrentSelectedMode { get => _OmnibarCurrentSelectedMode; set => SetProperty(ref _OmnibarCurrentSelectedMode, value); }
268-
269-
private string _OmnibarCurrentSelectedModeName;
266+
private string _OmnibarCurrentSelectedModeName = OmnibarPathModeName;
270267
public string OmnibarCurrentSelectedModeName { get => _OmnibarCurrentSelectedModeName; set => SetProperty(ref _OmnibarCurrentSelectedModeName, value); }
271268

272269
private CurrentInstanceViewModel _InstanceViewModel;

0 commit comments

Comments
 (0)