private void BackButtonService_NavigateBack(object sender, Common.HandledEventArgs e) { if (!IsModal) { return; } if (CanBackButtonDismiss && DisableBackButtonWhenModal) { e.Handled = true; IsModal = false; } else if (CanBackButtonDismiss && !DisableBackButtonWhenModal) { e.Handled = IsModal; IsModal = false; } else if (!CanBackButtonDismiss && DisableBackButtonWhenModal) { e.Handled = true; } else if (!CanBackButtonDismiss && !DisableBackButtonWhenModal) { e.Handled = false; } }
public static Common.HandledEventArgs RaiseForwardRequested() { var args = new Common.HandledEventArgs(); ForwardRequested?.Invoke(null, args); return(args); }
public Common.HandledEventArgs RaiseBackRequested() { var cancelEventArgs = new CancelEventArgs(); BeforeBackRequested?.Invoke(null, cancelEventArgs); if (cancelEventArgs.Cancel) { return(new Common.HandledEventArgs { Handled = true }); } var handledEventArgs = new Common.HandledEventArgs(); BackRequested?.Invoke(null, handledEventArgs); return(handledEventArgs); }
Common.HandledEventArgs IBackButtonService2.RaiseForwardRequested() { var cancelEventArgs = new CancelEventArgs(); BeforeForwardRequested?.Invoke(null, cancelEventArgs); if (cancelEventArgs.Cancel) { return(new Common.HandledEventArgs { Handled = true }); } var handledEventArgs = new Common.HandledEventArgs(); ForwardRequested?.Invoke(null, handledEventArgs); return(handledEventArgs); }