Dmitry Salenko
Dmitry Salenko

Reputation: 51

Closing event of UWP Flyout is not fired when switching to the other app

I develop UWP app using C# and XAML.

Flyout has following events: Closing and Closed

Case #1. When I close Flyout by clicking somewhere outside the order of events is Closing -> Closed. In handler of Closing event I can cancel hiding of Flyout by setting e.Cancel = true.

Case #2. When I open Flyout and then minimize the app / change size of the app / overlap the app by other app - Closing event is not fired. How can I cancel hiding of the Flyout in this case?

Also I have ContentDialog which is opened when I click on button inside Flyout. So in some moment there are Flyout and ContentDialog on the screen. When I switch to other app and then go back - ContentDialog is still visible but Flyout is not visible. I need to keep both Flyout and ContentDialog. How can I do it?

Thanks

Upvotes: 0

Views: 403

Answers (1)

Roy Li - MSFT
Roy Li - MSFT

Reputation: 8666

I need to keep both Flyout and ContentDialog. How can I do it?

I have to say that it is not possible to do that. Flyout is a control that displays lightweight UI that is either information or requires user interaction. Unlike a dialog, a Flyout can be lightly dismissed. Maybe you could consider using a Popup that won't be closed in these scenarios instead of using a Flyout.

Upvotes: 0

Related Questions