コード例 #1
0
        //Close Window with fade out animation
        private async void CloseSnap(bool result, int delay = 0, string errorMessage = null)
        {
            await this.AnimateAsync(OpacityProperty, Opacity, 0, 150, delay);

            try {
                if (result)
                {
                    await ScreenshotHelper.FinishGif(SelectionStream, HwndName);

                    try {
                        DialogResult = true;
                    } catch {
                        // not dialog
                    }
                    return;
                }
                if (Error)
                {
                    await Statics.ShowNotificationAsync(string.Format(strings.uploadingErrorGif, errorMessage),
                                                        NotificationWindow.NotificationType.Error);
                }
            } catch {
                // could not finish screenshot
            }
            try {
                DialogResult = false;
            } catch {
                // not dialog
            }
        }