move codes to parent class ctor

This commit is contained in:
NaBian committed 2019-11-29 22:16:59 +08:00
1 parent ca344f5a71
commit c8071f98bd
3 files changed
+9 -4

No files matched your search

@@ -4,8 +4,8 @@ using System.Windows;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Animation; using System.Windows.Media.Animation;
using HandyControl.Tools; using HandyControl.Tools;
// ReSharper disable PossibleInvalidOperationException
// ReSharper disable PossibleInvalidOperationException
namespace HandyControl.Media.Animation namespace HandyControl.Media.Animation
{ {
public class GeometryAnimation : GeometryAnimationBase public class GeometryAnimation : GeometryAnimationBase
@@ -20,7 +20,7 @@ namespace HandyControl.Media.Animation
public GeometryAnimation() public GeometryAnimation()
{ {
System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
} }
public GeometryAnimation(string fromValue, string toValue) : this() public GeometryAnimation(string fromValue, string toValue) : this()
@@ -1,4 +1,6 @@
using System; using System;
using System.Globalization;
using System.Threading;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Animation; using System.Windows.Media.Animation;
@@ -6,6 +8,11 @@ namespace HandyControl.Media.Animation
{ {
public abstract class GeometryAnimationBase : AnimationTimeline public abstract class GeometryAnimationBase : AnimationTimeline
{ {
protected GeometryAnimationBase()
{
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
}
public new GeometryAnimationBase Clone() => (GeometryAnimationBase)base.Clone(); public new GeometryAnimationBase Clone() => (GeometryAnimationBase)base.Clone();
public sealed override object GetCurrentValue(object defaultOriginValue, object defaultDestinationValue, AnimationClock animationClock) public sealed override object GetCurrentValue(object defaultOriginValue, object defaultDestinationValue, AnimationClock animationClock)
@@ -11,7 +11,6 @@ using System.Windows.Media.Animation;
using HandyControl.Tools; using HandyControl.Tools;
// ReSharper disable PossibleInvalidOperationException // ReSharper disable PossibleInvalidOperationException
namespace HandyControl.Media.Animation namespace HandyControl.Media.Animation
{ {
[ContentProperty("KeyFrames")] [ContentProperty("KeyFrames")]
@@ -40,7 +39,6 @@ namespace HandyControl.Media.Animation
public GeometryAnimationUsingKeyFrames() public GeometryAnimationUsingKeyFrames()
{ {
System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
_areKeyTimesValid = true; _areKeyTimesValid = true;
} }