Ejemplo n.º 1
0
        /// <summary>
        /// Shows the notification.
        /// </summary>
        /// <param name="useTransitions">If set to <c>true</c>, the <see cref="OnShowing"/> method will be invoked, and visual transitions will be used.</param>
        public void Show(bool useTransitions = true)
        {
            if (useTransitions)
            {
                State = LocalNotificationState.Showing;
                OnShowing();
            }

            VisualStateManager.GoToState(this, STATE_SHOWN, useTransitions);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Hides the notification.
        /// </summary>
        /// <param name="useTransitions">If set to <c>true</c>, the <see cref="OnHiding"/> method will be invoked, and visual transitions will be used.</param>
        public void Hide(bool useTransitions = true)
        {
            if (useTransitions)
            {
                State = LocalNotificationState.Hiding;
                OnHiding();
            }

            VisualStateManager.GoToState(this, STATE_HIDDEN, useTransitions);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Restores the notification.
        /// <para>The notification switches to the 'Shown' state, without transitions, after restoration.</para>
        /// </summary>
        /// <param name="useTransitions">If set to <c>true</c>, the <see cref="OnRestoring"/> method will be invoked, and visual transitions will be used.</param>
        public void Restore(bool useTransitions = true)
        {
            if (useTransitions)
            {
                State = LocalNotificationState.Restoring;
                OnRestoring();
            }

            VisualStateManager.GoToState(this, STATE_RESTORING, useTransitions);
        }
Ejemplo n.º 4
0
        private void LocalNotificationStates_CurrentStateChanged(object sender, VisualStateChangedEventArgs e)
        {
            switch (e.NewState.Name)
            {
            case STATE_SHOWN:
                State = LocalNotificationState.Shown;
                break;

            case STATE_RESTORING:
                Show(false);
                break;

            case STATE_HIDDEN:
                State = LocalNotificationState.Hidden;
                break;
            }
        }
 internal LocalNotificationStateChangedEventArgs(LocalNotificationState oldState, LocalNotificationState newState)
 {
     OldState = oldState;
     NewState = newState;
 }