當前位置: 首頁>>代碼示例>>C#>>正文


C# BackPressedEventArgs類代碼示例

本文整理匯總了C#中BackPressedEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# BackPressedEventArgs類的具體用法?C# BackPressedEventArgs怎麽用?C# BackPressedEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BackPressedEventArgs類屬於命名空間,在下文中一共展示了BackPressedEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: HardwareButtons_BackPressed

 private void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e) {
   var rootFrame = Window.Current.Content as Frame;
   if (rootFrame != null && rootFrame.CanGoBack) {
     rootFrame.GoBack();
     e.Handled = true;
   }
 }
開發者ID:azrawasia,項目名稱:appboy-windows-samples,代碼行數:7,代碼來源:App.xaml.cs

示例2: HardwareButtons_BackPressed

        async void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e)
        {
            if (this.Frame.SourcePageType.FullName == "StatusUp.MainPage")
            {
                e.Handled = true;
                // Create the message dialog and set its content
                var messageDialog = new MessageDialog("Close Application?");

                // Add commands and set their callbacks; both buttons use the same callback function instead of inline event handlers
                messageDialog.Commands.Add(new UICommand(
                    "Yes",
                    new UICommandInvokedHandler(this.CommandInvokedHandler)));
                messageDialog.Commands.Add(new UICommand(
                    "No",
                    new UICommandInvokedHandler(this.CommandInvokedHandler)));

                // Set the command that will be invoked by default
                messageDialog.DefaultCommandIndex = 0;

                // Set the command to be invoked when escape is pressed
                messageDialog.CancelCommandIndex = 1;

                // Show the message dialog
                try
                {
                    messageDialog.ShowAsync();
                }
                catch { }
            }
        }
開發者ID:jpdias,項目名稱:StatusUpdate-App,代碼行數:30,代碼來源:MainPage.xaml.cs

示例3: HardwareButtons_BackPressed

 protected void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e)
 {
     e.Handled = true;
     //We need this to handle backpress in ViewModels
     if (this.DataContext is BaseViewModel)
         (this.DataContext as BaseViewModel).GoBack();
 }
開發者ID:sggeng,項目名稱:ISupportIncrementalLoadingExample,代碼行數:7,代碼來源:AboutPage.xaml.cs

示例4: HardwareButtons_BackPressed

 private void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e)
 {
     e.Handled = true;
     if (CurrentPage == VLCPage.MainPageHome)
         e.Handled = false;
     GoBack_Specific();
 }
開發者ID:david-russo,項目名稱:vlc-winrt,代碼行數:7,代碼來源:NavigationService.cs

示例5: HardwareButtons_BackPressed

 private void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e)
 {
     if (Frame.CanGoBack) {
         e.Handled = true;
         Frame.GoBack();
     }
 }
開發者ID:losi999,項目名稱:FociWin,代碼行數:7,代碼來源:BasePage.cs

示例6: HardwareButtons_BackPressed

 void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e) {
     Frame rootFrame = Window.Current.Content as Frame;
     if (rootFrame != null && rootFrame.CanGoBack) {
         rootFrame.Navigate(typeof(PollutionReportPage));
         e.Handled = true;
     }
 }
開發者ID:ReecePatterson,項目名稱:Synergy,代碼行數:7,代碼來源:WaterQualityReportPage.xaml.cs

示例7: HardwareButtons_BackPressed_DetailPage

        async void HardwareButtons_BackPressed_DetailPage(object sender, BackPressedEventArgs e)
        {
            e.Handled = true;
            if (string.IsNullOrEmpty(ViewModel.Tasks.Title))
            {
                NavigateHelper.NavigateToPage(typeof(MainPage));
                return;
            }
            //此處最好進行一個判斷,是更新還是新增操作,然後進行相關的數據庫操作
            Task taskNeedAwait = null;
            FrameTransitionParam param = new FrameTransitionParam();
            if (this.IsNavigateForUpdate)//true表示更新
            {
                // 修改的數據
                param.UpdateTasks = ViewModel.Tasks;
                taskNeedAwait = ViewModel.UpdateTasks();
            }
            else//false 表示新增
            {
                param.NewTasks = ViewModel.Tasks;
                taskNeedAwait = ViewModel.AddTasks();
            }
            // 在跳轉前取消注冊
            HardwareButtons.BackPressed -= HardwareButtons_BackPressed_DetailPage;
            NavigateHelper.NavigateToPageWithParam(typeof(MainPage), param);

            await taskNeedAwait;
        }
開發者ID:fqncom,項目名稱:tomcraporigami,代碼行數:28,代碼來源:TasksDetailPageSimple.xaml.cs

示例8: HardwareButtonsOnBackPressed

        private void HardwareButtonsOnBackPressed(object sender, BackPressedEventArgs backPressedEventArgs)
        {
            if (ViewModel.IsSignInPageVisible)
            {
                var storyboard = (Storyboard)Resources["SignInModalHideStoryboard"];
                if (storyboard == null) return;
                storyboard.Begin();
                ViewModel.GoBackToStartCommand.Execute(null);
                backPressedEventArgs.Handled = true;
            }

            if (ViewModel.IsRegisterPageVisible)
            {
                var storyboard = (Storyboard)Resources["RegistrationModalHideStoryboard"];
                if (storyboard == null) return;
                storyboard.Begin();
                ViewModel.GoBackToStartCommand.Execute(null);
                backPressedEventArgs.Handled = true;
            }

            if (ViewModel.IsCaptchaPageVisible)
            {
                var storyboard = (Storyboard)Resources["CaptchaModalHideStoryboard"];
                if (storyboard == null) return;
                storyboard.Begin();
                ViewModel.GoBackToStartCommand.Execute(null);
                backPressedEventArgs.Handled = true;
            }
        }
開發者ID:0xdeafcafe,項目名稱:SnapDotNet,代碼行數:29,代碼來源:StartPage.xaml.cs

示例9: OnBackPress

        private void OnBackPress(object sender, BackPressedEventArgs e)
        {
            e.Handled = true;

             if (Frame.CanGoBack)
            Frame.GoBack();
        }
開發者ID:VladimirTurov,項目名稱:simple-rss-reader,代碼行數:7,代碼來源:NewsDetailsPage.xaml.cs

示例10: HardwareButtons_BackPressed

 private void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e)
 {
     if (Frame.BackStackDepth == 0)
     {
         Application.Current.Exit();
     }
 }
開發者ID:crowdhackathon-transport,項目名稱:AthensTransit,代碼行數:7,代碼來源:EntryPage.xaml.cs

示例11: HardwareButtons_BackPressed

 private void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e)
 {
     if (!e.Handled)
     {
         e.Handled = true;
         Task t = BackButtonPressed();
     }
 }
開發者ID:Speedydown,項目名稱:Thirty_Seconds_WP,代碼行數:8,代碼來源:GameViewModel.cs

示例12: HardwareButtons_BackPressed

 void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e)
 {
     if (appBarToggleButton.IsChecked == true)
     {
         appBarToggleButton.IsChecked = false;
         e.Handled = true;
     }
 }
開發者ID:LONELY-WOLF,項目名稱:InterfaceSample,代碼行數:8,代碼來源:MainPage.xaml.cs

示例13: HardwareButtons_BackPressed

 private void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e)
 {
     if (InstanceMessageService.RootFrame != null && InstanceMessageService.RootFrame.CanGoBack)
     {
         e.Handled = true;
         InstanceMessageService.RootFrame.GoBack();
     }
 }
開發者ID:dmitry-osin,項目名稱:Drugs.WP8.1,代碼行數:8,代碼來源:App.xaml.cs

示例14: OnBackPressed

 public void OnBackPressed(object sender, BackPressedEventArgs e)
 {
     if (Frame.CanGoBack)
     {
         e.Handled = true;
         Frame.GoBack();
     }
 }
開發者ID:conhacktivate,項目名稱:DX12Test,代碼行數:8,代碼來源:MainPage.xaml.cs

示例15: HardwareButtons_BackPressed

 void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e)
 {
     if (VideoViewComboBox.IsDropDownOpen)
     {
         VideoViewComboBox.IsDropDownOpen = false;
         e.Handled = true;
     }
 }
開發者ID:robUx4,項目名稱:vlc-winrt,代碼行數:8,代碼來源:VideoPaneComboBox.xaml.cs


注:本文中的BackPressedEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。