diff --git a/MapControl/WPF/MapBase.WPF.cs b/MapControl/WPF/MapBase.WPF.cs index ad309c4b..c67dc751 100644 --- a/MapControl/WPF/MapBase.WPF.cs +++ b/MapControl/WPF/MapBase.WPF.cs @@ -149,13 +149,12 @@ namespace MapControl { if (centerAnimation != null) { - SetValueInternal(CenterProperty, TargetCenter); - UpdateTransform(); - centerAnimation.Completed -= CenterAnimationCompleted; centerAnimation = null; BeginAnimation(CenterProperty, null); + SetValueInternal(CenterProperty, TargetCenter); + UpdateTransform(); } } @@ -215,13 +214,12 @@ namespace MapControl { if (zoomLevelAnimation != null) { - SetValueInternal(ZoomLevelProperty, TargetZoomLevel); - UpdateTransform(true); - zoomLevelAnimation.Completed -= ZoomLevelAnimationCompleted; zoomLevelAnimation = null; BeginAnimation(ZoomLevelProperty, null); + SetValueInternal(ZoomLevelProperty, TargetZoomLevel); + UpdateTransform(true); } } @@ -276,13 +274,12 @@ namespace MapControl { if (headingAnimation != null) { - SetValueInternal(HeadingProperty, TargetHeading); - UpdateTransform(); - headingAnimation.Completed -= HeadingAnimationCompleted; headingAnimation = null; BeginAnimation(HeadingProperty, null); + SetValueInternal(HeadingProperty, TargetHeading); + UpdateTransform(); } } } diff --git a/MapControl/WinUI/MapBase.WinUI.cs b/MapControl/WinUI/MapBase.WinUI.cs index 39b9fdee..58275873 100644 --- a/MapControl/WinUI/MapBase.WinUI.cs +++ b/MapControl/WinUI/MapBase.WinUI.cs @@ -175,11 +175,11 @@ namespace MapControl { if (centerAnimation != null) { - SetValueInternal(CenterProperty, TargetCenter); - UpdateTransform(); - centerAnimation.Completed -= CenterAnimationCompleted; centerAnimation = null; + + SetValueInternal(CenterProperty, TargetCenter); + UpdateTransform(); } } @@ -270,11 +270,11 @@ namespace MapControl { if (zoomLevelAnimation != null) { - SetValueInternal(ZoomLevelProperty, TargetZoomLevel); - UpdateTransform(true); - zoomLevelAnimation.Completed -= ZoomLevelAnimationCompleted; zoomLevelAnimation = null; + + SetValueInternal(ZoomLevelProperty, TargetZoomLevel); + UpdateTransform(true); } } @@ -346,11 +346,11 @@ namespace MapControl { if (headingAnimation != null) { - SetValueInternal(HeadingProperty, TargetHeading); - UpdateTransform(); - headingAnimation.Completed -= HeadingAnimationCompleted; headingAnimation = null; + + SetValueInternal(HeadingProperty, TargetHeading); + UpdateTransform(); } }