private static void OnPowerChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { RectangleCardCanvas canvas = d as RectangleCardCanvas; if (e.NewValue != null) { string power = e.NewValue.ToString(); if (!string.IsNullOrEmpty(power)) { canvas.TextBoxPower.Visibility = Visibility.Visible; canvas.TextBoxPower.Text = power; } canvas.TextBoxPower.BeginAnimation(OpacityProperty, GetPowerAnimation(canvas.TextBoxPower.ActualWidth)); canvas.TextBoxPower.BeginAnimation(OpacityProperty, GetPowerAnimation(canvas.TextBoxPower.ActualHeight)); } else { canvas.TextBoxPower.Visibility = Visibility.Hidden; } }
private static void OnCandidateGameIdsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { RectangleCardCanvas canvas = d as RectangleCardCanvas; canvas.CandidateGameIdsChanged((Collection <int>)e.NewValue, canvas.RectangleCardFrame); }