Пример #1
0
 protected override void OnBackKeyPress(CancelEventArgs e)
 {
     if (this._isSettingsOpen)
     {
         this.CloseSettings();
         e.set_Cancel(true);
         return;
     }
     if (this.TxtHeader.get_Text() != "Kênh Yêu Thích")
     {
         this.TxtHeader.set_Text("Kênh Yêu Thích");
         this.LoadKenhYeuThich();
         e.set_Cancel(true);
         return;
     }
     if (!IsolatedStorageSettings.get_ApplicationSettings().Contains("IdApp"))
     {
         e.set_Cancel(true);
         this.PopupFace.set_Visibility(0);
     }
     else
     {
         if (!IsolatedStorageSettings.get_ApplicationSettings().get_Item("IdApp").ToString().EndsWith(this._listAdses.get_Item(0).Id))
         {
             e.set_Cancel(true);
             this.PopupFace.set_Visibility(0);
             return;
         }
         if (MessageBox.Show("Bạn có thực sự muốn thoát không", "Thoát", 1) != 1)
         {
             e.set_Cancel(true);
             return;
         }
     }
 }