Skip to content

Commit

Permalink
fix: 启动后不自动选择目录项
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaitonn committed Jan 22, 2025
1 parent 5daf425 commit 4ca3700
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Serein.Plus/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
ui:TitleBar.Height="36"
ui:WindowHelper.SystemBackdropType="Mica"
ui:WindowHelper.UseModernWindowStyle="True"
Loaded="Window_Loaded"
Closing="Window_Closing"
ContentRendered="Window_ContentRendered"
Deactivated="Window_Deactivated"
Expand Down
7 changes: 7 additions & 0 deletions src/Serein.Plus/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ private void Window_IsVisibleChanged(object sender, DependencyPropertyChangedEve
Topmost = false;
}
}

private void Window_Loaded(object sender, RoutedEventArgs e)
{
NavView.SelectedItem = NavView.MenuItems[0];
ContentFrame.Navigate(_services.GetRequiredService<ServerPage>());
}

private void Window_Closing(object sender, CancelEventArgs e)
{
Expand Down Expand Up @@ -302,4 +308,5 @@ private void ContentFrame_Navigated(object sender, NavigationEventArgs e)
NavView.IsBackEnabled = ContentFrame.CanGoBack;
ContentFrame.RemoveBackEntry();
}

}

0 comments on commit 4ca3700

Please sign in to comment.