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