Vidyano.PhoneHooks.ShowNotification C# (CSharp) Метод

ShowNotification() публичный Метод

public ShowNotification ( string notification, NotificationType notificationType ) : Task
notification string
notificationType NotificationType
Результат Task
        public override async Task ShowNotification(string notification, NotificationType notificationType)
        {
            var messageBox = new CustomMessageBox
                             {
                                 Caption = Service.Current.Messages[notificationType.ToString()],
                                 Message = notification,
                                 LeftButtonContent = Service.Current.Messages["OK"],
                                 RightButtonContent = Service.Current.Messages["Copy"]
                             };

            var waiter = new AutoResetEvent(false);
            messageBox.Dismissed += (s1, e1) =>
            {
                if (e1.Result == CustomMessageBoxResult.RightButton)
                    Clipboard.SetText(notification);

                waiter.Set();
            };

            messageBox.Show();

            await Task.Factory.StartNew(() => waiter.WaitOne());
        }