UIElement.GetAnimationBaseValue(DependencyProperty) UIElement.GetAnimationBaseValue(DependencyProperty) UIElement.GetAnimationBaseValue(DependencyProperty) UIElement.GetAnimationBaseValue(DependencyProperty) Method

定義

傳回這個項目上指定屬性的基底屬性值,不管任何執行中的可能動畫值,或停止動畫。Returns the base property value for the specified property on this element, disregarding any possible animated value from a running or stopped animation.

public:
 virtual System::Object ^ GetAnimationBaseValue(System::Windows::DependencyProperty ^ dp);
public object GetAnimationBaseValue (System.Windows.DependencyProperty dp);
abstract member GetAnimationBaseValue : System.Windows.DependencyProperty -> obj
override this.GetAnimationBaseValue : System.Windows.DependencyProperty -> obj
Public Function GetAnimationBaseValue (dp As DependencyProperty) As Object

參數

dp
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

要檢查的相依性屬性。The dependency property to check.

傳回

屬性值,就好像指定的相依性屬性未附加任何動畫。The property value as if no animations are attached to the specified dependency property.

實作

範例

下列範例會報告動畫的基底值的處理常式Width屬性上的Button,以及轉換的基底值。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.

// 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));

}
' Display the base value for Button.Width and RotateTransform.Angle.
Private Sub animatedButton_Clicked(ByVal sender As Object, ByVal e As RoutedEventArgs)
	Dim animatedButton As Button = CType(sender, Button)
          MessageBox.Show("Button width base value: " & animatedButton.GetAnimationBaseValue(Button.WidthProperty).ToString & vbLf & "RotateTransform base value: " & animatedRotateTransform.GetAnimationBaseValue(RotateTransform.AngleProperty).ToString)
      End Sub

備註

如果未不附加任何動畫屬性,則GetAnimationBaseValue傳回值一定是相同GetValue傳回值。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.

適用於

另請參閱