MainPage.cs に selectionChanged イベント ハンドラーを書きましたが、ピボット ページを変更しても反応しません。
private void MainPage_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
Debug.WriteLine("Pivot selection changed");
switch (((Pivot)sender).SelectedIndex)
{
case 0:
Debug.WriteLine("LoginAppBar launched");
ApplicationBar = ((ApplicationBar)Application.Current.Resources["LoginAppBar"]);
break;
case 1:
Debug.WriteLine("DefaultAppBar launched");
ApplicationBar = ((ApplicationBar)Application.Current.Resources["AppBar"]);
break;
case 2:
Debug.WriteLine("DefaultAppBar launched");
ApplicationBar = ((ApplicationBar)Application.Current.Resources["AppBar"]);
break;
}
}
このイベント ハンドラーが機能しないのはなぜですか? メソッドの名前ですか?method-header を private void に変更してみましたmyNameSpaceHere_SelectionChanged(object sender, SelectionChangedEventArgs e)
しかし、それでもイベントをキャッチしません。
任意のヒント?