Skip to content

How to make the "Home" in navigationview already clicked and shows the page content of "Home"when i run the mainwindow #992

Closed Locked Answered by pomianowski
Chrlss asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, you can add a Loaded event to your MainWindow. Once the window is loaded, you can tell the navigation to navigate to a specific page.

private void OnMainWindowLoaded(object sender, RoutedEventArgs e)
{
if (sender is not MainWindow mainWindow)
{
return;
}
_ = mainWindow.NavigationView.Navigate(typeof(DashboardPage));
}

public partial class MainWindow
{
public MainWindow()
{
DataContext = this;
Appearance.SystemThemeWatcher.Watch(t…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Chrlss
Comment options

Answer selected by pomianowski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants