File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src/Local/Project1.UI/Controls/ChartControl Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -421,9 +421,7 @@ public Chart()
421421 {
422422 DefaultStyleKey = typeof ( Chart ) ;
423423 storyboard = new Storyboard ( ) ;
424- storyboard . Duration = TimeSpan . FromSeconds ( 1 ) ;
425424 scrollStoryboard = new Storyboard ( ) ;
426- //scrollStoryboard.Duration = TimeSpan.FromSeconds(1);
427425 scrollStoryboard . Completed += ( e , c ) =>
428426 {
429427 //容器滚动动画结束
@@ -541,10 +539,13 @@ public override void OnApplyTemplate()
541539 } ;
542540 }
543541 MouseLeave += Chart_MouseLeave ;
544- Render ( ) ;
545- //Loaded += Chart_Loaded;
542+ Loaded += Chart_Loaded ;
546543 }
547544
545+ private void Chart_Loaded ( object sender , RoutedEventArgs e )
546+ {
547+ Render ( ) ;
548+ }
548549
549550 private void Render ( )
550551 {
@@ -709,6 +710,9 @@ private void InitAnimation()
709710 Storyboard . SetTarget ( averageLabelValueAnimation , this ) ;
710711 Storyboard . SetTargetProperty ( averageLabelValueAnimation , new PropertyPath ( AverageProperty ) ) ;
711712
713+ averageAnimation . Duration = new Duration ( TimeSpan . FromSeconds ( .8 ) ) ;
714+ averageLabelAnimation . Duration = new Duration ( TimeSpan . FromSeconds ( .8 ) ) ;
715+ averageLabelValueAnimation . Duration = new Duration ( TimeSpan . FromSeconds ( .8 ) ) ;
712716
713717 storyboard . Children . Add ( averageAnimation ) ;
714718 storyboard . Children . Add ( averageLabelAnimation ) ;
You can’t perform that action at this time.
0 commit comments