Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF C# Frame Navigation from page navigated

i've a windows and a frame in this windows. the frame navigate in a page and into this page i've a button. The page was created dinamically so, i want to add a event onclick of button into the page, that permit me to navigate a new page into frame of window.

i'm writing on google about custom event that can permit me to raise an event in a page that is related to event in a window.

Can you help me please??

like image 428
loris91 Avatar asked Mar 23 '26 23:03

loris91


1 Answers

If I understand correctly, you want to navigate from one page to another using a event?

If that is the case, take a look at the following links below - these will give you a better understanding of navigating through a WPF application providing examples and sample apps.

How to Build, Manage and Navigate the User Interface of a WPF Application

Simple Navigation

This is how I achieve it. In the code behind of your application, do something like this to help navigate to the next page for your click event;

private void btnClick_HomeClick(object sender, RoutedEventArgs e)
{
     FrameContent.Navigate(new ExampleView()); //FrameContent is the name given to the frame within the xaml.
}

Hope this helps!

like image 105
greg Avatar answered Mar 26 '26 13:03

greg