OpenFlyout() public method

public OpenFlyout ( Flyout flyout ) : Task
flyout MahApps.Metro.Controls.Flyout
return Task
Example #1
0
        private async void ExceptionlessSubmittingEvent(object sender, EventSubmittingEventArgs e)
        {
            if (e.IsUnhandledError)
            {
                e.Cancel = true;

                await Application.Current.Dispatcher.Invoke(async() =>
                {
                    modelHelpers.CloseAllFlyouts();
                    await modelHelpers.OpenFlyout(new Error(modelHelpers, e.Event));
                    modelHelpers.CloseApp(true);
                });
            }
        }
Example #2
0
        private async void ExceptionlessSubmittingEvent(object sender, EventSubmittingEventArgs e)
        {
            if (!registered)
            {
                return;
            }

            if (e.IsUnhandledError)
            {
                e.Cancel = true;

                await Application.Current.Dispatcher.Invoke(async() =>
                {
                    modelHelpers.CloseAllFlyouts();

                    var resetTopMostSetting = false;
                    if (!modelHelpers.Gallifrey.Settings.UiSettings.TopMostOnFlyoutOpen)
                    {
                        modelHelpers.Gallifrey.Settings.UiSettings.TopMostOnFlyoutOpen = true;
                        resetTopMostSetting = true;
                    }

                    await modelHelpers.OpenFlyout(new Error(modelHelpers, e.Event));

                    if (resetTopMostSetting)
                    {
                        modelHelpers.Gallifrey.Settings.UiSettings.TopMostOnFlyoutOpen = false;
                    }

                    modelHelpers.CloseApp(true);
                });
            }
            else if (e.Event.IsError() || e.Event.IsCritical())
            {
                e.Event.AddTags("Handled");
            }
        }