Ejemplo n.º 1
0
        public void RestoreState(StarMemento memento)
        {
            Logger.Log("Хранитель: Состояние звезды восстановлено");

            State = memento.State;
            State.AnimateNewState(this);

            DoubleAnimation animation = new DoubleAnimation(0, TimeSpan.FromSeconds(0.5));

            animation.Completed += (sender, e) => {
                Canvas.SetLeft(this, memento.Left);
                Canvas.SetTop(this, memento.Top);
                BeginAnimation(OpacityProperty, new DoubleAnimation(1, TimeSpan.FromSeconds(0.5)));
            };
            BeginAnimation(OpacityProperty, animation);
        }
Ejemplo n.º 2
0
 private void BtnMemento_Click(object sender, RoutedEventArgs e)
 {
     memento = StarSingletonFactory.GetStar().SaveState();
 }