Inheritance: System.Windows.DependencyObject
Exemplo n.º 1
0
        protected override Size ArrangeOverride(Size arrangeSize)
        {
            arrangeSize = base.ArrangeOverride(arrangeSize);

            foreach (var child in this.InternalChildren.OfType <FrameworkElement>())
            {
                var oldOffset = GetOffset(child);
                var newOffset = VisualTreeHelper.GetOffset(child);
                if (EqualityComparer <Vector> .Default.Equals(oldOffset, new Vector(Double.NaN, Double.NaN)))
                {
                    AnimationManager.StartEntryAnimation(child);
                }
                else if (oldOffset != newOffset)
                {
                    AnimationManager.StartRepositionAnimation(child, newOffset - oldOffset);
                }

                SetOffset(child, newOffset);
            }

            return(arrangeSize);
        }
Exemplo n.º 2
0
        private async void DemoWindow_Loaded(object sender, RoutedEventArgs e)
        {
            SizeToContent = System.Windows.SizeToContent.Manual;
            await GifRecorderManager.Instance.CurrentStoryboardsCompleted();

            _viewModel.Collection.Clear();

            var originalTitle = Title;

            Title = "Recording...";

            using (GifRecorderManager.Instance.StartRecording(this, Root, "basic_projection.gif", 10))
            {
                foreach (var item in new[] { 1, 2, 3, 4, 5, 6, 7, 8 })
                {
                    _viewModel.Collection.Add(item);
                }

                AnimationManager.StartEntryAnimation(SourceLabel);

                await GifRecorderManager.Instance.CurrentStoryboardsCompleted();

                AnimationManager.StartEntryAnimation(TargetLabel);
                AnimationManager.StartEntryAnimation(Label1);
                _viewModel.SelectedOption = _viewModel.DataOptions[6];

                await GifRecorderManager.Instance.CurrentStoryboardsCompleted();

                //await AnimationManager.Pause(1000);

                System.Diagnostics.Debug.WriteLine("Removing");
                AnimationManager.StartExitAnimation(Label1);
                AnimationManager.StartEntryAnimation(Label2);
                _viewModel.Collection.RemoveAt(3);

                await GifRecorderManager.Instance.CurrentStoryboardsCompleted();

                //await AnimationManager.Pause(1000);

                AnimationManager.StartExitAnimation(Label2);
                AnimationManager.StartEntryAnimation(Label3);
                _viewModel.Collection.Insert(0, 4);

                await GifRecorderManager.Instance.CurrentStoryboardsCompleted();

                // await AnimationManager.Pause(1000);

                AnimationManager.StartExitAnimation(Label3);
                AnimationManager.StartEntryAnimation(Label4);
                _viewModel.Collection.Move(0, 3);

                await GifRecorderManager.Instance.CurrentStoryboardsCompleted();

                //await AnimationManager.Pause(1000);

                AnimationManager.StartExitAnimation(Root, 10, -5);

                await GifRecorderManager.Instance.CurrentStoryboardsCompleted();
            }

            Close();
        }