Sanguosha.UI.Controls.PlayerView.model_PropertyChanged C# (CSharp) Méthode

model_PropertyChanged() private méthode

private model_PropertyChanged ( object sender, PropertyChangedEventArgs e ) : void
sender object
e System.ComponentModel.PropertyChangedEventArgs
Résultat void
        void model_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            PlayerViewModel model = sender as PlayerViewModel;
            if (e.PropertyName == "CurrentPhase")
            {
                if (model.CurrentPhase == Core.Games.TurnPhase.Inactive)
                {
                    imgPhase.Visibility = System.Windows.Visibility.Hidden;
                }
                else
                {
                    imgPhase.Visibility = System.Windows.Visibility.Visible;
                    Storyboard animation = Resources["sbPhaseChange"] as Storyboard;
                    animation.Begin(this);
                }
            }
            else if (e.PropertyName == "TimeOutSeconds")
            {
                Duration duration = new Duration(TimeSpan.FromSeconds(model.TimeOutSeconds));
                DoubleAnimation doubleanimation = new DoubleAnimation(100d, 0d, duration);
                progressBar.BeginAnimation(ProgressBar.ValueProperty, doubleanimation);
            }
            else if (e.PropertyName == "IsDead")
            {
                Storyboard deathAnimation = (Resources["sbDeathTransition"] as Storyboard);
                Trace.Assert(deathAnimation != null);
                if (model.IsDead)
                {
                    deathAnimation.Begin(this);
                }
                else
                {
                    deathIcon.BeginAnimation(Image.OpacityProperty, null);
                    deathIcon.Opacity = 0.0d;
                    deathEffect.BeginAnimation(Effects.MonochromeEffect.StrengthProperty, null);
                    deathEffect.Strength = 0.0d;
                    deathAnimation.Stop();
                    deathAnimation.Remove(this);
                }
            }
        }