Esempio n. 1
0
        public ItemAnimations()
        {
            this.InitializeComponent();
            this.DataContext = this;

            this.combo.ItemsSource  = Enum.GetValues(typeof(ItemAnimationMode));
            this.combo.SelectedItem = ItemAnimationMode.PlayAll;

            RadMoveAndFadeAnimation animation = new RadMoveAndFadeAnimation();

            animation.FadeAnimation.Duration     = new Duration(TimeSpan.FromSeconds(1.5));
            animation.FadeAnimation.StartOpacity = 0.5;
            animation.FadeAnimation.EndOpacity   = 1;
            animation.MoveAnimation.StartPoint   = new Point(40, 0);
            animation.MoveAnimation.EndPoint     = new Point(0, 0);
            animation.MoveAnimation.Duration     = new Duration(TimeSpan.FromSeconds(1.5));
            this.listView.ItemAddedAnimation     = animation;

            RadMoveAndFadeAnimation animation2 = new RadMoveAndFadeAnimation();

            animation2.FadeAnimation.Duration     = new Duration(TimeSpan.FromSeconds(1.5));
            animation2.FadeAnimation.StartOpacity = 1;
            animation2.FadeAnimation.EndOpacity   = 0.5;
            animation2.MoveAnimation.StartPoint   = new Point(0, 0);
            animation2.MoveAnimation.EndPoint     = new Point(40, 0);
            animation2.MoveAnimation.Duration     = new Duration(TimeSpan.FromSeconds(1.5));
            this.listView.ItemRemovedAnimation    = animation2;
        }
Esempio n. 2
0
        public NotificationWindow(string header, string message, double width, Action tapFunction, double visibleTime = 4000)
        {
            var openAnimation = new RadMoveAndFadeAnimation();
            openAnimation.MoveAnimation.StartPoint = new Point(-200, 0);
            openAnimation.MoveAnimation.EndPoint = new Point(0, 0);
            openAnimation.FadeAnimation.StartOpacity = 0;
            openAnimation.FadeAnimation.EndOpacity = 1;
            openAnimation.Duration = new Duration(TimeSpan.FromMilliseconds(200));

            var closeAnimation = new RadMoveAndFadeAnimation();
            closeAnimation.MoveAnimation.StartPoint = new Point(0, 0);
            closeAnimation.MoveAnimation.EndPoint = new Point(200, 0);
            closeAnimation.FadeAnimation.StartOpacity = 1;
            closeAnimation.FadeAnimation.EndOpacity = 0;
            closeAnimation.Duration = new Duration(TimeSpan.FromMilliseconds(200));

            var headerBlock = new TextBlock { Text = header.ToUpper(), FontSize = (double)App.Current.Resources["PhoneFontSizeMedium"], FontWeight = FontWeights.SemiBold, TextWrapping = TextWrapping.Wrap };
            var messageBlock = new TextBlock { Text = message, TextWrapping = TextWrapping.Wrap };

            var stackPanel = new StackPanel();
            stackPanel.Margin = new Thickness(24, 12, 24, 6);
            stackPanel.Children.Add(headerBlock);
            stackPanel.Children.Add(messageBlock);

            var grid = new Grid();
            grid.Background = (Brush)App.Current.Resources["PhoneAccentBrush"];
            grid.Width = width;
            grid.Children.Add(stackPanel);

            var closeTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(visibleTime + 200) };
            closeTimer.Tick += closeTimer_Tick;

            this.Placement = PlacementMode.TopCenter;
            this.OpenAnimation = openAnimation;
            this.CloseAnimation = closeAnimation;
            this.Content = grid;
            this.TapFunction = tapFunction;
            this.Tap += NotificationWindow_Tap;
            this.ManipulationCompleted += NotificationWindow_ManipulationCompleted;
            this.IsOpen = true;
            closeTimer.Start();
        }
Esempio n. 3
0
        private void PrepareAnimations()
        {
            Func <RadMoveAndFadeAnimation> createAddAnimation = () =>
            {
                var duration    = new TimeSpan(0, 0, 0, 0, 500);
                var moveAndFade = new RadMoveAndFadeAnimation();
                moveAndFade.MoveAnimation.StartPoint   = new Point(0, -90);
                moveAndFade.MoveAnimation.EndPoint     = new Point(0, 0);
                moveAndFade.FadeAnimation.StartOpacity = 0;
                moveAndFade.FadeAnimation.EndOpacity   = 1;
                moveAndFade.Easing   = new CubicEase();
                moveAndFade.Duration = new Duration(duration);
                return(moveAndFade);
            };

            this.ForumItemSelector.ItemAddedAnimation          = createAddAnimation();
            this.UngroupedForumItemSelector.ItemAddedAnimation = createAddAnimation();

            Func <RadMoveAndFadeAnimation> createRemoveAnimation = () =>
            {
                var duration    = new TimeSpan(0, 0, 0, 0, 500);
                var moveAndFade = new RadMoveAndFadeAnimation();
                moveAndFade.MoveAnimation.StartPoint   = new Point(0, 0);
                moveAndFade.MoveAnimation.EndPoint     = new Point(0, -90);
                moveAndFade.FadeAnimation.StartOpacity = 1;
                moveAndFade.FadeAnimation.EndOpacity   = 0;
                moveAndFade.Easing = new CubicEase()
                {
                    EasingMode = EasingMode.EaseOut
                };
                moveAndFade.Duration = new Duration(duration);
                return(moveAndFade);
            };

            this.ForumItemSelector.ItemRemovedAnimation          = createRemoveAnimation();
            this.UngroupedForumItemSelector.ItemRemovedAnimation = createRemoveAnimation();
        }
        private void PrepareAnimations()
        {
            Func<RadMoveAndFadeAnimation> createAddAnimation = () =>
            {
                var duration = new TimeSpan(0, 0, 0, 0, 500);
                var moveAndFade = new RadMoveAndFadeAnimation();
                moveAndFade.MoveAnimation.StartPoint = new Point(0, -90);
                moveAndFade.MoveAnimation.EndPoint = new Point(0, 0);
                moveAndFade.FadeAnimation.StartOpacity = 0;
                moveAndFade.FadeAnimation.EndOpacity = 1;
                moveAndFade.Easing = new CubicEase();
                moveAndFade.Duration = new Duration(duration);
                return moveAndFade;
            };

            this.ForumItemSelector.ItemAddedAnimation = createAddAnimation();
            this.UngroupedForumItemSelector.ItemAddedAnimation = createAddAnimation();

            Func<RadMoveAndFadeAnimation> createRemoveAnimation = () =>
            {
                var duration = new TimeSpan(0, 0, 0, 0, 500);
                var moveAndFade = new RadMoveAndFadeAnimation();
                moveAndFade.MoveAnimation.StartPoint = new Point(0, 0);
                moveAndFade.MoveAnimation.EndPoint = new Point(0, -90);
                moveAndFade.FadeAnimation.StartOpacity = 1;
                moveAndFade.FadeAnimation.EndOpacity = 0;
                moveAndFade.Easing = new CubicEase() { EasingMode = EasingMode.EaseOut };
                moveAndFade.Duration = new Duration(duration);
                return moveAndFade;
            };

            this.ForumItemSelector.ItemRemovedAnimation = createRemoveAnimation();
            this.UngroupedForumItemSelector.ItemRemovedAnimation = createRemoveAnimation();
        }
Esempio n. 5
0
        private void PrepareAnimations()
        {
            var duration = new TimeSpan(0, 0, 0, 0, 500);

            var setAddAnimation = new Action<RadVirtualizingDataControl>(listBox =>
                {
                    var moveAndFade = new RadMoveAndFadeAnimation();
                    moveAndFade.MoveAnimation.StartPoint = new Point(0, -90);
                    moveAndFade.MoveAnimation.EndPoint = new Point(0, 0);
                    moveAndFade.FadeAnimation.StartOpacity = 0;
                    moveAndFade.FadeAnimation.EndOpacity = 1;
                    moveAndFade.Easing = new CubicEase();
                    moveAndFade.Duration = new Duration(duration);

                    listBox.ItemAddedAnimation = moveAndFade;
                });

            var setRemoveAnimation = new Action<RadVirtualizingDataControl>(listBox =>
                {
                    var moveAndFade = new RadMoveAndFadeAnimation();
                    moveAndFade.MoveAnimation.StartPoint = new Point(0, 0);
                    moveAndFade.MoveAnimation.EndPoint = new Point(0, -90);
                    moveAndFade.FadeAnimation.StartOpacity = 1;
                    moveAndFade.FadeAnimation.EndOpacity = 0;
                    moveAndFade.Easing = new CubicEase() { EasingMode = EasingMode.EaseOut };
                    moveAndFade.Duration = new Duration(duration);

                    listBox.ItemRemovedAnimation = moveAndFade;
                });

            setAddAnimation(this.ThreadsList);
            setRemoveAnimation(this.ThreadsList);

            setAddAnimation(this.NewThreadsList);
            setRemoveAnimation(this.NewThreadsList);

            setAddAnimation(this.ReadThreadsList);
            setRemoveAnimation(this.ReadThreadsList);

            setAddAnimation(this.MiscFilterList);
            setRemoveAnimation(this.MiscFilterList);
        }
Esempio n. 6
0
        private void PrepareAnimations()
        {
            InteractionEffectManager.AllowedTypes.Add(typeof(RadDataBoundListBoxItem));

            Func<RadMoveAndFadeAnimation> createAddAnimation = () =>
            {
                var duration = new TimeSpan(0, 0, 0, 0, 500);
                var moveAndFade = new RadMoveAndFadeAnimation();
                moveAndFade.MoveAnimation.StartPoint = new Point(0, -90);
                moveAndFade.MoveAnimation.EndPoint = new Point(0, 0);
                moveAndFade.FadeAnimation.StartOpacity = 0;
                moveAndFade.FadeAnimation.EndOpacity = 1;
                moveAndFade.Easing = new CubicEase();
                moveAndFade.Duration = new Duration(duration);
                return moveAndFade;
            };

            FavoritesListBox.ItemAddedAnimation = createAddAnimation();
            BookmarksList.ItemAddedAnimation = createAddAnimation();
            ForumsList.ItemAddedAnimation = createAddAnimation();

            Func<RadMoveAndFadeAnimation> createRemoveAnimation = () =>
            {
                var duration = new TimeSpan(0, 0, 0, 0, 500);
                var moveAndFade = new RadMoveAndFadeAnimation();
                moveAndFade.MoveAnimation.StartPoint = new Point(0, 0);
                moveAndFade.MoveAnimation.EndPoint = new Point(0, -90);
                moveAndFade.FadeAnimation.StartOpacity = 1;
                moveAndFade.FadeAnimation.EndOpacity = 0;
                moveAndFade.Easing = new CubicEase() { EasingMode = EasingMode.EaseOut };
                moveAndFade.Duration = new Duration(duration);
                return moveAndFade;
            };

            BookmarksList.ItemRemovedAnimation = createRemoveAnimation();
            ForumsList.ItemRemovedAnimation = createRemoveAnimation();
        }