mui
mui copied to clipboard
How to navigate to home page from another page in WPF Navigation Application template
Hello everyone,i'm a new bie in wpf and mui too, i'm using Modern UI WPF Navigation Application template in my application. and i have an additional page, i have a home button on that page and i want to navigate to my home page when i click to that button. i don't know how to do that. Please help me.
Add this XAML to your page:
<Button Content="Home" Command="mui:LinkCommands.NavigateLink" CommandParameter="Path/To/HomePage.xaml" />
Change the CommandParameter
part to point to your home page.
Hope this helps.
Thank you, TransientResponse. it's work fine, but how can I pass some arguments to home page? I don't want to create a static variable. Thank you.
Hey @hoctrokha , you can use this:
var Page2= new Page2(); //create your new form.
Page2.Show(); //show the new form.
this.Close(); //only if you want to close the current form.