UIElement.GetAnimationBaseValue(DependencyProperty) Método

Definição

Devolve o valor base da propriedade especificada neste elemento, desconsiderando qualquer valor animado possível de uma animação em execução ou parada.

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

Parâmetros

dp
DependencyProperty

A propriedade de dependência a verificar.

Devoluções

O valor da propriedade como se nenhuma animação estivesse associada à propriedade de dependência especificada.

Implementações

Exemplos

O exemplo seguinte implementa um handler que reporta o valor base de uma propriedade animada Width num Button, bem como o valor base de uma transformação.

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

Observações

Se não houver animações associadas à propriedade, então o valor de retorno GetAnimationBaseValue é sempre idêntico ao GetValue valor de retorno. Se houver animações anexadas, então todos os valores possíveis derivados da animação, incluindo os valores de início e fim, são ignorados, e o valor da propriedade é determinado com base em todas as outras possíveis entradas. Para mais informações, consulte Precedência de Valor de Propriedade de Dependência.

Aplica-se a

Ver também