本文整理汇总了C#中BackPressedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# BackPressedEventArgs类的具体用法?C# BackPressedEventArgs怎么用?C# BackPressedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BackPressedEventArgs类属于命名空间,在下文中一共展示了BackPressedEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: HardwareButtons_BackPressed
void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e)
{
if (IsPaneOpen)
{
IsPaneOpen = false;
e.Handled = true;
}
}
开发者ID:fubar-coder,项目名称:bifrost.xaml,代码行数:8,代码来源:SplitView.cs
示例17: OnBackPressed
private void OnBackPressed(object sender, BackPressedEventArgs e)
{
if (this.RootFrame != null && this.RootFrame.CanGoBack)
{
e.Handled = true;
this.RootFrame.GoBack();
}
}
开发者ID:cstehreem,项目名称:WinRTXamlToolkit,代码行数:8,代码来源:AppShell.xaml.cs
示例18: OnBackPressed
// handle hardware back button press
void OnBackPressed(object sender, BackPressedEventArgs e)
{
var shell = (Shell)Window.Current.Content;
if (shell.RootFrame.CanGoBack) {
e.Handled = true;
shell.RootFrame.GoBack();
}
}
开发者ID:diblaze,项目名称:TravelplannerOstgota,代码行数:9,代码来源:App.xaml.cs
示例19: BackPressed
private void BackPressed(object s, BackPressedEventArgs args)
{
if (ConfirmationWeb.Visibility == Visibility.Visible && ConfirmationWeb.CanGoBack && confWebUrl != confUrl)
{
ConfirmationWeb.GoBack();
args.Handled = true;
}
}
开发者ID:Black4Blade,项目名称:UnofficialSteamAuthenticator,代码行数:8,代码来源:MainPage.xaml.cs
示例20: MainPage_BackPressed
private void MainPage_BackPressed(object sender, BackPressedEventArgs e)
{
if (WebViewControl.CanGoBack)
{
WebViewControl.GoBack();
e.Handled = true;
}
}
开发者ID:trilok567,项目名称:Windows-Phone,代码行数:8,代码来源:MainPage.xaml.cs
注:本文中的BackPressedEventArgs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论