AnimatedVisualPlayer.AnimationOptimization 속성

정의

가 유휴 상태일 때 AnimatedVisualPlayer 애니메이션이 캐시되는 방식을 지정하는 값을 가져오거나 설정합니다(가 활성 상태가 아닌 경우 PlayAsync ).

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

속성 값

가 유휴 상태일 때 AnimatedVisualPlayer 애니메이션이 캐시되는 방식을 지정하는 값입니다(가 활성 상태가 아닌 경우 PlayAsync ). 기본값은 Latency입니다.

특성
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackAttribute Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValueAttribute

예제

클릭 시 시작하는 애니메이션이 있는 경우 속성을 Resources로 초기화합니다. 그런 다음 마우스가 컨트롤에 들어갈 때 로 설정하고 AnimationOptimizationLatency 마우스가 컨트롤을 떠날 때 로 돌아갑니다 Resources . 이렇게 하면 리소스를 불필요하게 사용하지 않고 애니메이션이 클릭 즉시 시작됩니다.

애니메이션이 로드되기 전에 PlayAsync를 호출하면 모든 애니메이션이 완전히 로드될 때까지 플레이어가 시작되지 않습니다.

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

설명

플레이어의 또는 AnimationOptimizationSource 설정하면 레이아웃이 처리될 때까지 플레이어가 원본 파일의 처리를 연기합니다.

적용 대상

추가 정보