mui icon indicating copy to clipboard operation
mui copied to clipboard

How to navigate to home page from another page in WPF Navigation Application template

Open hoctrokha opened this issue 9 years ago • 3 comments

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.

hoctrokha avatar Aug 18 '15 09:08 hoctrokha

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.

TransientResponse avatar Sep 28 '15 19:09 TransientResponse

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.

hoctrokha avatar Oct 06 '16 02:10 hoctrokha

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.

miladxandi avatar Dec 16 '17 04:12 miladxandi