UIElement.GetAnimationBaseValue(DependencyProperty) Method

Definition

Returns the base property value for the specified property on this element, disregarding any possible animated value from a running or stopped animation.

C#
public object GetAnimationBaseValue(System.Windows.DependencyProperty dp);

Parameters

dp
DependencyProperty

The dependency property to check.

Returns

The property value as if no animations are attached to the specified dependency property.

Implements

Examples

The following example implements a handler that reports the base value of an animated Width property on a Button, as well as the base value of a transform.

C#
// Display the base value for Button.Width and RotateTransform.Angle.
private void animatedButton_Clicked(object sender, RoutedEventArgs e)
{
    Button animatedButton = (Button)sender;
    MessageBox.Show("Button width base value: " + 
        animatedButton.GetAnimationBaseValue(Button.WidthProperty)
        + "\nRotateTransform base value: " +
        animatedRotateTransform.GetAnimationBaseValue(RotateTransform.AngleProperty));
}

Remarks

If no animations are attached to the property, then the GetAnimationBaseValue return value is always identical to the GetValue return value. If there are animations attached, then all possible animation derived values including the start and stop values are ignored, and the property value is determined based on all other possible inputs. For more information, see Dependency Property Value Precedence.

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also