Skip to content

Commit

Permalink
Fix crash due to uninitialized XamlRoot when activating a dialog on O…
Browse files Browse the repository at this point in the history
…OBE page
  • Loading branch information
gaviny82 committed Dec 25, 2024
1 parent 7c9061e commit 3909fc9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Natsurainko.FluentLauncher/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ public MainWindow(

private void MainWindow_Activated(object sender, WindowActivatedEventArgs args)
{
_navigationService.NavigateTo(_settingsService.FinishGuide ? "ShellPage" : "OOBENavigationPage");

this.CenterOnScreen();

if (_settingsService.AppWindowState == WindowState.Maximized)
Expand Down Expand Up @@ -109,5 +107,9 @@ void ConfigureWindow()
this.Activated += MainWindow_Activated;
}

private void Frame_Loaded(object sender, RoutedEventArgs e) => XamlRoot = Frame.XamlRoot;
private void Frame_Loaded(object sender, RoutedEventArgs e)
{
XamlRoot = Frame.XamlRoot;
_navigationService.NavigateTo(_settingsService.FinishGuide ? "ShellPage" : "OOBENavigationPage");
}
}

0 comments on commit 3909fc9

Please sign in to comment.