예제 #1
0
            public Storyboard CreateShowing(OverlaidContent target)
            {
                var content         = (PictureViewContent)target;
                var duration        = 250;
                var exponentialEase = new ExponentialEase()
                {
                    EasingMode = EasingMode.EaseOut, Exponent = 5
                };
                var transform = content.PicturePreviewControl.GetTransformTo(content.SourceControl);

                var translateX = new TranslateX(content.PicturePreviewControl)
                {
                    From = transform.TranslateX / 2, Duration = duration, EasingFunction = exponentialEase
                };
                var translateY = new TranslateY(content.PicturePreviewControl)
                {
                    From = transform.TranslateY / 2, Duration = duration, EasingFunction = exponentialEase
                };
                var scaleX = new ScaleX(content.PicturePreviewControl)
                {
                    From = transform.ScaleX + (1 - transform.ScaleX) / 2, To = 1, Duration = duration, EasingFunction = exponentialEase
                };
                var scaleY = new ScaleY(content.PicturePreviewControl)
                {
                    From = transform.ScaleY + (1 - transform.ScaleY) / 2, To = 1, Duration = duration, EasingFunction = exponentialEase
                };

                var storyboard = new Storyboard();

                storyboard.Children.Add(translateX.GetTimeline());
                storyboard.Children.Add(translateY.GetTimeline());
                storyboard.Children.Add(scaleX.GetTimeline());
                storyboard.Children.Add(scaleY.GetTimeline());
                return(storyboard);
            }
예제 #2
0
        private static Storyboard CreateDetailsHidingTransition(FrameworkElement target)
        {
            var translateX = new TranslateX(target)
            {
                To = target.ActualWidth, Duration = 500, EasingFunction = new ExponentialEase()
                {
                    EasingMode = EasingMode.EaseOut, Exponent = 8
                }
            };
            var storyboard = new Storyboard();

            storyboard.Children.Add(translateX.GetTimeline());
            return(storyboard);
        }
예제 #3
0
            public Storyboard CreateHiding(OverlaidContent target)
            {
                var content         = (PictureViewContent)target;
                var duration        = 250;
                var exponentialEase = new ExponentialEase()
                {
                    EasingMode = EasingMode.EaseOut, Exponent = 5
                };
                var transform = content.PicturePreviewControl.GetTransformTo(content.SourceControl);

                ApplyUniformToFillRule(content.PicturePreviewControl.RenderSize, content.SourceControl.RenderSize, transform);

                var translateX = new TranslateX(content.PicturePreviewControl)
                {
                    To = transform.TranslateX, Duration = duration, EasingFunction = exponentialEase
                };
                var translateY = new TranslateY(content.PicturePreviewControl)
                {
                    To = transform.TranslateY, Duration = duration, EasingFunction = exponentialEase
                };
                var scaleX = new ScaleX(content.PicturePreviewControl)
                {
                    From = 1, To = transform.ScaleX, Duration = duration, EasingFunction = exponentialEase
                };
                var scaleY = new ScaleY(content.PicturePreviewControl)
                {
                    From = 1, To = transform.ScaleY, Duration = duration, EasingFunction = exponentialEase
                };
                var background = new ValueSetterAnimation(content.LayoutControl, nameof(Background))
                {
                    Value = new SolidColorBrush(Colors.Transparent)
                };

                var storyboard = new Storyboard();

                storyboard.Children.Add(translateX.GetTimeline());
                storyboard.Children.Add(translateY.GetTimeline());
                storyboard.Children.Add(scaleX.GetTimeline());
                storyboard.Children.Add(scaleY.GetTimeline());
                storyboard.Children.Add(background.GetTimeline());
                return(storyboard);
            }