@@ -63,15 +63,15 @@ protected override void OnApplyTemplate()
6363 base . OnApplyTemplate ( ) ;
6464
6565 _shape = GetTemplateChild ( PART_Shape ) as Border ;
66- if ( _initialized is false && TryInitializationResource ( ) && IsAnimating )
66+ if ( _initialized is false && TryInitializationResource ( ) && IsActive )
6767 {
6868 TryStartAnimation ( ) ;
6969 }
7070 }
7171
7272 private void OnLoaded ( object sender , RoutedEventArgs e )
7373 {
74- if ( _initialized is false && TryInitializationResource ( ) && IsAnimating )
74+ if ( _initialized is false && TryInitializationResource ( ) && IsActive )
7575 {
7676 TryStartAnimation ( ) ;
7777 }
@@ -194,14 +194,14 @@ private void TryStartAnimation()
194194 _rectangleGeometry . StartAnimation ( nameof ( CompositionRoundedRectangleGeometry . Size ) , _sizeAnimation ) ;
195195
196196 _gradientStartPointAnimation = rootVisual . Compositor . CreateVector2KeyFrameAnimation ( ) ;
197- _gradientStartPointAnimation . Duration = TimeSpan . FromMilliseconds ( AnimationDurationInMilliseconds ) ;
197+ _gradientStartPointAnimation . Duration = Duration ;
198198 _gradientStartPointAnimation . IterationBehavior = AnimationIterationBehavior . Forever ;
199199 _gradientStartPointAnimation . InsertKeyFrame ( 0.0f , new Vector2 ( InitialStartPointX , 0.0f ) ) ;
200200 _gradientStartPointAnimation . InsertKeyFrame ( 1.0f , Vector2 . Zero ) ;
201201 _shimmerMaskGradient . StartAnimation ( nameof ( CompositionLinearGradientBrush . StartPoint ) , _gradientStartPointAnimation ) ;
202202
203203 _gradientEndPointAnimation = rootVisual . Compositor . CreateVector2KeyFrameAnimation ( ) ;
204- _gradientEndPointAnimation . Duration = TimeSpan . FromMilliseconds ( AnimationDurationInMilliseconds ) ;
204+ _gradientEndPointAnimation . Duration = Duration ;
205205 _gradientEndPointAnimation . IterationBehavior = AnimationIterationBehavior . Forever ;
206206 _gradientEndPointAnimation . InsertKeyFrame ( 0.0f , new Vector2 ( 1.0f , 0.0f ) ) ; //Vector2.One
207207 _gradientEndPointAnimation . InsertKeyFrame ( 1.0f , new Vector2 ( - InitialStartPointX , 1.0f ) ) ;
0 commit comments