This question is locked. New answers and comments are not allowed.
I am using RadMessageBox inside the OnBackKeyPressed event with some plumbing necessary to manage the non-modal running.
For either Save or Discard button, finally I GoBack(). So I don't have any problem. But when the cancel is pressed, I want to stay in the current page. Yes, it does stay in the current page but the ApplicationBar is vanishing.
My code is as below:
How can I make the ApplicationBar not vanish? Was it because I am using it in the OnBackKeyPressed event?
ThanQ...
For either Save or Discard button, finally I GoBack(). So I don't have any problem. But when the cancel is pressed, I want to stay in the current page. Yes, it does stay in the current page but the ApplicationBar is vanishing.
My code is as below:
protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e){ if (popup1.IsOpen) { popup1.IsOpen = false; e.Cancel = true; } else { if (TaskModified()) { if (!isBackKeyInProgress) { RadMessageBox.Show(new CustomHeaderedContentControl[] { new CustomHeaderedContentControl() { Title = "Save", Message = "This details will be saved to the database." }, new CustomHeaderedContentControl() { Title = "Discard", Message = "This details will NOT be saved to the database." }, new CustomHeaderedContentControl() { Title = "Cancel", Message = "Returns to the details for further editing." } }, "Back Key Pressed", "You are about to close the details editor. What do you want to do?", closedHandler: (args) => { // ClickedButton will be null in the case when RadMessageBox is closed because the user pressed the hardware back button. if (args.ClickedButton == null) { DiscardTask(); } CustomHeaderedContentControl option = (CustomHeaderedContentControl)args.ClickedButton.Content; if (option.Title == "Save") { SaveTask(false); } if (option.Title == "Discard") { DiscardTask(); } if (option.Title == "Cancel") { // Return to editing the task. SystemTray.SetProgressIndicator(this, null); return; } }); isBackKeyInProgress = true; e.Cancel = true; } } if (!isBackKeyInProgress) NavigateBack(true); SystemTray.SetProgressIndicator(this, App.sysProgressBar);}How can I make the ApplicationBar not vanish? Was it because I am using it in the OnBackKeyPressed event?
ThanQ...