AnimatedVisualPlayer.AnimationOptimization Propiedad

Definición

Obtiene o establece un valor que especifica cómo se almacenan en caché las animaciones cuando AnimatedVisualPlayer está inactivo (cuando PlayAsync no está activo).

public:
 property PlayerAnimationOptimization AnimationOptimization { PlayerAnimationOptimization get(); void set(PlayerAnimationOptimization value); };
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::PlayerAnimationOptimization::Latency")]
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::PlayerAnimationOptimization::Latency")]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::PlayerAnimationOptimization::Latency")]
PlayerAnimationOptimization AnimationOptimization();

void AnimationOptimization(PlayerAnimationOptimization value);
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::PlayerAnimationOptimization::Latency")]
public PlayerAnimationOptimization AnimationOptimization { [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)] [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::PlayerAnimationOptimization::Latency")] get; [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)] [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::PlayerAnimationOptimization::Latency")] set; }
Public Property AnimationOptimization As PlayerAnimationOptimization

Valor de propiedad

Valor que especifica cómo se almacenan en caché las animaciones cuando AnimatedVisualPlayer está inactivo (cuando PlayAsync no está activo). El valor predeterminado es Latency.

Atributos
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackAttribute Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValueAttribute

Ejemplos

Si tiene una animación que se inicia en un clic, inicialice la propiedad en Resources. A continuación, establezca AnimationOptimization en Latency cuando el mouse entre en el control y vuelva a cuando Resources el mouse salga del control. Esto garantiza que la animación se inicia inmediatamente al hacer clic sin usar recursos innecesariamente.

Si llamas a PlayAsync antes de cargar las animaciones, el reproductor no se iniciará hasta que todas las animaciones se carguen por completo.

private void Player_PointerEntered(object sender, PointerRoutedEventArgs e)
{
    myanimatedvisualplayer.AnimationOptimization = AnimationOptimization.Latency;
}
async private void Player_PointerExited(object sender, PointerRoutedEventArgs e)
{              
    myanimatedvisualplayer.AnimationOptimization = AnimationOptimization.Resources;
}
async private void Player_OnClick(object sender, PointerRoutedEventArgs e)
{              
    myanimatedvisualplayer.PlayAsync(0.0, 1.0);
}

Comentarios

Si estableces el Source o AnimationOptimization del reproductor, el jugador aplazará el procesamiento del archivo de origen hasta que se procese el diseño.

Se aplica a

Consulte también