コード例 #1
0
 void ShowActionAlert(PushDemoAction action)
 => MainThread.BeginInvokeOnMainThread(()
                                       => MainPage?.DisplayAlert("PushDemo", $"{action} action received", "OK").ContinueWith((task)
                                                                                                                             => { if (task.IsFaulted)
                                                                                                                                  {
                                                                                                                                      throw task.Exception;
                                                                                                                                  }
                                                                                                                             }));
コード例 #2
0
 void TakeAction(PushDemoAction action) => MainThread.BeginInvokeOnMainThread(()
                                                                              =>
 {
     try
     {
         var Page = (MainPage as NavigationPage).RootPage as MainTabbedPage;
         if (Page != null)       //mainpage là trang tabbedpage
         {
             Page.CurrentPage = Page.Children[1];
         }
         else
         {
             // vẫn ở trang login, login xong vào thẳng trang thông báo
             MainPage = new NavigationPage(new Login(1));
         }
     }
     catch (Exception e)
     {
     }
 });
コード例 #3
0
 void NotificationActionTriggered(object sender, PushDemoAction e)
 => ShowActionAlert(e);
コード例 #4
0
 void NotificationActionTriggered(object sender, PushDemoAction e) => TakeAction(e);