2
我有两个页面和一个MainWindow ..我在两个框架中加载页面..现在我想执行彼此的方法..我怎么能做到这一点?wpf中的页面之间的通信
这是Page1.cs:
public partial class Page1 : Page
{
public Method1()
{
doSomething;
}
}
这是Page2.cs:
public partial class Page2 : Page
{
public Method2()
{
doSomethingElse;
}
}
在我的主窗口会发生以下情况:
Frame1.Source = new Uri("/Source/Pages/Page1.xaml", UriKind.RelativeOrAbsolute);
Frame2.Source = new Uri("/Source/Pages/Page2.xaml", UriKind.RelativeOrAbsolute);
有什么办法,以从Page1.cs执行Method2,从Page2.cs执行Method1?
Regards