/// <summary>
        /// This method will change the animation mode
        /// </summary>
        /// <param name="message"></param>
        public virtual void Handle(ChangeAnimationModeRequest message)
        {
            if (!(ContentFrame is AnimationFrame animationFrame))
            {
                return;
            }

            // Maybe we can't access it directly
            if (!animationFrame.CheckAccess())
            {
                try
                {
                    animationFrame.Dispatcher.Invoke(() => Handle(message), DispatcherPriority.Normal, CancellationToken.None, InvocationTimeout);
                }
                catch (TimeoutException)
                {
                    Trace.TraceWarning("Can't dispatch ChangeAnimationModeRequest in time, so try to invoke async");
                    animationFrame.Dispatcher.InvokeAsync(() => Handle(message));
                }

                return;
            }

            // Switch the Animation Mode
            AnimationMode oldMode = animationFrame.AnimationMode;

            animationFrame.AnimationMode = message.AnimationMode;
            message.AnimationMode        = oldMode;
        }
Exemple #2
0
        /// <summary>
        /// Send FullMode Request when the user touches the Selected Item
        /// </summary>
        private void OnEnterFullModeViaTouch(object sender, TouchEventArgs e)
        {
            if (IsReadonly)
            {
                return;
            }

            if (IsTouchSelectionEnabled)
            {
                oldAnimationMode = Kernel.Instance.EventAggregator.PublishMessage(new ChangeAnimationModeRequest(Frames.AnimationMode.Fade));
                Kernel.Instance.EventAggregator.PublishMessage(new DatePickerFullModeRequest(FullModeHeader, Value, DatePickerId));
            }
        }