Interaction logic for HealthBar.xaml
Inheritance: System.Windows.Controls.UserControl
Ejemplo n.º 1
0
        private static void OnHealthChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            VHealthBar bar       = (VHealthBar)d;
            int        oldHealth = (int)e.OldValue;
            int        newHealth = (int)e.NewValue;

            bar.Repaint();

            if (newHealth < oldHealth)
            {
                bar.PlayLoseHealthAnimation(oldHealth, newHealth);
            }
        }
Ejemplo n.º 2
0
        static void OnMaxHealthChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            VHealthBar bar = (VHealthBar)d;

            bar.Repaint();
        }