Fluent.Ribbon
Fluent.Ribbon copied to clipboard
Cancel backstage close event
Is there a way to do cancel a backstage close event? I only see IsOpenChanged which does not allow setting e.Cancel on the event in question. The use case is a delayed operation on a form in the backstage needing to complete.
Currently there is no way to do so. But it sounds like a good addition.
Just had a look at the code and you can prevent closing the Backstage already.
Just set CanChangeIsOpen to false to prevent the Backstage from being closed during your delayed operation.
Would be nice if you could report back if that worked in your situation.
I'm not sure that quite solves my scenario, because I need to cancel a backstage close operation in progress, not just prevent one from happening. Ie, from this location:
private void Backstage_IsOpenChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
{
var newvalue = (bool)e.NewValue;
var oldvalue = (bool)e.OldValue;
if (oldvalue && !newvalue)
{
The scenario is that closing the backstage triggers a form being saved, as it indicates the user is done changing values. I suppose I could find another trigger point.