Skip to content

Commit 0113aa9

Browse files
committed
Fix crash
1 parent 2ad1b5b commit 0113aa9

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/Files.App/UserControls/NavigationToolbar.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@
225225
<controls:Omnibar
226226
x:Name="Omnibar"
227227
Grid.Column="1"
228+
x:Load="{x:Bind ViewModel.LoadOmnibar, Mode=OneWay}"
228229
CurrentSelectedModeName="{x:Bind ViewModel.OmnibarCurrentSelectedModeName, Mode=TwoWay}"
229230
IsFocusedChanged="Omnibar_IsFocusedChanged"
230231
ModeChanged="Omnibar_ModeChanged"

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ public string? PathText
197197
}
198198
}
199199

200+
// Workaround to ensure Omnibar is only loaded after the ViewModel is initialized
201+
public bool LoadOmnibar =>
202+
true;
203+
200204
private string? _OmnibarCommandPaletteModeText;
201205
public string? OmnibarCommandPaletteModeText { get => _OmnibarCommandPaletteModeText; set => SetProperty(ref _OmnibarCommandPaletteModeText, value); }
202206

0 commit comments

Comments
 (0)