EasingDoubleKeyFrame Classe
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Associe une fonction d’accélération à une animation d’images clés DoubleAnimationUsingKeyFrames .
public ref class EasingDoubleKeyFrame sealed : DoubleKeyFrame
/// [Windows.Foundation.Metadata.Activatable(65536, "Microsoft.UI.Xaml.WinUIContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.WinUIContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class EasingDoubleKeyFrame final : DoubleKeyFrame
[Windows.Foundation.Metadata.Activatable(65536, "Microsoft.UI.Xaml.WinUIContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.WinUIContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class EasingDoubleKeyFrame : DoubleKeyFrame
Public NotInheritable Class EasingDoubleKeyFrame
Inherits DoubleKeyFrame
<EasingDoubleKeyFrame .../>
- Héritage
- Attributs
Exemples
Cet exemple XAML montre comment utiliser des images clés qui ont des fonctions d’accélération associées pour créer une animation d’un rectangle qui se contracte vers le haut, ralentit, puis se développe vers le bas (comme si elle tombe), puis rebondit à un arrêt.
<StackPanel x:Name="LayoutRoot" >
<StackPanel.Resources>
<Storyboard x:Name="myStoryboard">
<DoubleAnimationUsingKeyFrames
Storyboard.TargetProperty="Height"
Storyboard.TargetName="myRectangle" EnableDependentAnimation="true">
<!-- This keyframe animates the ellipse up to the crest
where it slows down and stops. -->
<EasingDoubleKeyFrame Value="30" KeyTime="00:00:02">
<EasingDoubleKeyFrame.EasingFunction>
<CubicEase EasingMode="EaseOut"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
<!-- This keyframe animates the ellipse back down and makes
it bounce. -->
<EasingDoubleKeyFrame Value="200" KeyTime="00:00:06">
<EasingDoubleKeyFrame.EasingFunction>
<BounceEase Bounces="5" EasingMode="EaseOut"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</StackPanel.Resources>
<Rectangle x:Name="myRectangle" PointerPressed="Pointer_Clicked"
Fill="Blue" Width="200" Height="200" />
</StackPanel>
// When the user clicks the rectangle, the animation
// begins.
private void Pointer_Clicked(object sender, PointerRoutedEventArgs e)
{
myStoryboard.Begin();
}
Remarques
Les fonctions de lissage vous permettent d’appliquer des formules mathématiques personnalisées à vos animations. Les opérations mathématiques sont souvent utiles pour produire des animations qui simulent la physique réelle dans un système de coordonnées 2D. Par exemple, vous souhaiterez peut-être qu’un objet rebondisse ou se comporte comme s’il était sur un ressort. Pour obtenir la liste des fonctions d’accélération et des informations sur leur utilisation, consultez les animations d’images clés et les animations de fonction d’accélération.
Si aucune fonction d’accélération n’est définie, la fonction d’accélération par défaut est linéaire.
Constructeurs
| Nom | Description |
|---|---|
| EasingDoubleKeyFrame() |
Initialise une nouvelle instance de la classe EasingDoubleKeyFrame . |
Propriétés
| Nom | Description |
|---|---|
| Dispatcher |
Retourne |
| DispatcherQueue |
Obtient le |
| EasingFunction |
Obtient ou définit la fonction d’accélération appliquée au cadre clé. |
| EasingFunctionProperty |
Identifie la propriété de dépendance EasingFunction . |
| KeyTime |
Obtient ou définit l’heure à laquelle la valeur cible de l’image clé doit être atteinte. (Hérité de DoubleKeyFrame) |
| Value |
Obtient ou définit la valeur cible de l’image clé. (Hérité de DoubleKeyFrame) |
Méthodes
| Nom | Description |
|---|---|
| ClearValue(DependencyProperty) |
Efface la valeur locale d’une propriété de dépendance. (Hérité de DependencyObject) |
| GetAnimationBaseValue(DependencyProperty) |
Retourne toute valeur de base établie pour une propriété de dépendance, qui s’applique dans les cas où une animation n’est pas active. (Hérité de DependencyObject) |
| GetValue(DependencyProperty) |
Retourne la valeur effective actuelle d’une propriété de dépendance à partir d’un DependencyObject. (Hérité de DependencyObject) |
| ReadLocalValue(DependencyProperty) |
Retourne la valeur locale d’une propriété de dépendance, si une valeur locale est définie. (Hérité de DependencyObject) |
| RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback) |
Inscrit une fonction de notification pour écouter les modifications apportées à une dependencyProperty spécifique sur cette instance DependencyObject . (Hérité de DependencyObject) |
| SetValue(DependencyProperty, Object) |
Définit la valeur locale d’une propriété de dépendance sur un DependencyObject. (Hérité de DependencyObject) |
| UnregisterPropertyChangedCallback(DependencyProperty, Int64) |
Annule une notification de modification qui a été précédemment inscrite en appelant RegisterPropertyChangedCallback. (Hérité de DependencyObject) |