【发布时间】:2019-01-21 02:44:37
【问题描述】:
我有一个主窗口,它是在我的项目中显示不同页面的框架,我想在单击页面上的按钮时更改框架中的页面。
问题是我似乎无法让 Frame 包含单击按钮时的事件处理程序,它似乎是页面本身的本地事件。 Frame 是否有办法查看何时单击页面的按钮并相应地更改页面?
Main.Content = new Page.Intro();
但是,当在Page.Intro() 内点击按钮Next 时,我想在Main Window Class 内显示
Main.Content = new Page.Home(userinformation);
我尝试关注How to click a button of the page to change the source of the frame of Windows?,这与我想要实现的目标类似,尽管我的页面有我需要传递的参数,所以我不能调用MainContent.Source = new Uri("Home.xaml", UriKind.Relative);,因为没有地方可以传递userinformation .
【问题讨论】:
标签: c# wpf master-pages