Exemple #1
0
        private void DismissToast(DismissStatus dismissStatus, bool continueGestureAnimation = false)
        {
            ToastControlMainBorder.ManipulationStarted   -= OnMainBorderManipulationStarted;
            ToastControlMainBorder.ManipulationDelta     -= OnMainBorderManipulationDelta;
            ToastControlMainBorder.ManipulationCompleted -= OnMainBorderManipulationCompleted;

            Storyboard leavingStoryboard;

            if (continueGestureAnimation)
            {
                leavingStoryboard = XamlReader.Load(SlideOutStoryboard) as Storyboard;
            }
            else
            {
                leavingStoryboard = XamlReader.Load(SwivelOutStoryboard) as Storyboard;
            }
            Deployment.Current.Dispatcher.BeginInvoke(() =>
            {
                foreach (Timeline t in leavingStoryboard.Children)
                {
                    Storyboard.SetTarget(t, ToastControlMainBorder);
                }

                leavingStoryboard.Begin();
                leavingStoryboard.Completed += delegate
                {
                    _toastNotificationManager.RemoveNotificationFromVisualTree(this);
                    CompleteToast(dismissStatus);
                };
            });

            _dismissTimer = null;
        }
Exemple #2
0
 internal void CompleteToast(DismissStatus dismissStatus, bool notifyManager = true)
 {
     if (notifyManager)
     {
         _toastNotificationManager.CompleteToast(this);
     }
     RaiseCompleted(new ToastCompletedEventArgs(dismissStatus));
 }
        private async void OnSwipeNotificationStep2ButtonTapped(object sender, GestureEventArgs e)
        {
            SimpleToastNotification simpleToastNotification = new SimpleToastNotification();

            simpleToastNotification.Title = "PRISM has been removed to favorites";
            simpleToastNotification.Id    = "album.favoritestatus.27493";
            DismissStatus result = await simpleToastNotification.EnqueueAndShow(_notificationManager);
        }
        private async void OnSimpleAsyncTextToastButtonTapped(object sender, GestureEventArgs e)
        {
            SimpleToastNotification simpleToastNotification = new SimpleToastNotification();

            simpleToastNotification.Title = "Do you want to tap me async ?";
            DismissStatus result = await simpleToastNotification.EnqueueAndShow(_notificationManager);

            MessageBox.Show("Toast has been dismissed: " + result);
        }
 public ToastCompletedEventArgs(DismissStatus dismissStatus)
 {
     DismissStatus = dismissStatus;
 }
 private void SaveChangesToLastSelectedDayOfWeek()
 {
     var status = new DismissStatus(radioButtonDismissed.Checked, textBoxDescription.Text);
     _dismisses[_lastSelectedDay] = status;
 }