Example #1
0
        private async Task DisplayCustomDialog(DialogContent.DialogContent content)
        {
            var settings = new MetroDialogSettings
            {
                AnimateShow             = false,
                AnimateHide             = false,
                OwnerCanCloseWithDialog = false,
            };

            try
            {
                var dialog = new CustomDialog(settings)
                {
                    Background = Brushes.Transparent, Content = content
                };
                content.DialogResult += OnDialogResult;
                await this.ShowMetroDialogAsync(dialog).ConfigureAwait(false);

                NativeMethods.FlashWindow(this.Hwnd);
            }
            catch (Exception e)
            {
                Logger.Error("Failed to display custom dialog", e);
            }
        }
Example #2
0
 private async void OnDialogResult(DialogContent.DialogContent sender)
 {
     sender.DialogResult -= OnDialogResult;
     try
     {
         if (sender.ParentDialog != null)
         {
             await App.Current.Dispatcher.InvokeAsync(async() =>
             {
                 await this.HideMetroDialogAsync(sender.ParentDialog).ConfigureAwait(false);
             });
         }
     }
     catch (Exception e)
     {
         Logger.Error("Failed to hide custom dialog", e);
     }
 }
Example #3
0
 private void OnReviewDialogResult(DialogContent.DialogContent sender)
 {
     sender.DialogResult -= OnReviewDialogResult;
     requestReview        = false;
 }