アプリケーションに 2 つのページがあります。ナビゲーションは MainPage > EditPage > MainPage に従います。MainPage は開始ページであり、編集ページはボタンのクリック時に NavigatedTo になり、ハードウェアの戻るボタンを使用して NavigatedFrom になる場合があります。EditPage で何らかのアクションが発生した場合、ユーザーが MainPage に戻りたいときに MainPage に通知したいと思います。http://mobile.dzone.com/articles/passing-values-between-windowsを参照しましたが、それに応じて MainPage OnNavigatedTo イベントを修正する方法がわかりません。これまでのところ、私が持っているものは次のとおりです
MainPage.xaml.cs
protected override void OnNavigatedTo(NavigationEventArgs e)
{
//If action in EditPage occurred, determine that here
??
}
EditPage.xaml.cs
protected override void OnNavigatedFrom(NavigationEventArgs e)
{
base.OnNavigatedFrom(e);
//check to see if action occurred in EditPage, and if so, inform MainPage
if (_wasEdited == true)
{
MainPage mp = e.Content as MainPage;
if (mp != null)
mp.Parameter = true;
}
}