[英]How can I get Variable from One Page To Other Page withput using navigation In UWP C#?
我需要幫助.. []
_eMARTimer.Stop();
_faxTimer.Stop();
_faxRingtoneTimer.Stop();
這是我的主頁,我想在第二頁的薄頁 from.cs 頁面中執行這些方法] 1
請幫我解決這個問題。 非常感謝您給予您的關注。
我想在第二頁的薄頁 from.cs 頁面中執行這些方法
對於這種情況,您可以使用 mvvmlight Messenger
來接近。 而如果其他頁面和發送頁面不在同一個window。 您需要在 xaml 中設置其他page NavigationCacheMode="Required"
。
public MainPage()
{
this.InitializeComponent();
Messenger.Default.Register<bool>(this,(s) =>
{
if (s)
{
_eMARTimer.Stop();
_faxTimer.Stop();
_faxRingtoneTimer.Stop();
}
});
}
第二頁
Messenger.Default.Send<bool>(true);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.