protected override void ApplySettings(UIAnimationSettings settings) { _animatedObj = UIObject as IUIColored; if (_animatedObj == null) { throw new Exception("The animated object is not IColored"); } if (!(settings is UIColorAnimationSettings colorSettings)) { throw new ArgumentException("UIColorAnimation: The given settings is not UIColorAnimationSettings"); } if (colorSettings.FromColor.ColorType != colorSettings.ToColor.ColorType) { throw new Exception("UIColorAnimationSettings.FromColor.Type != UIColorAnimationSettings.ToColor.Type"); } FromColor = colorSettings.FromColor; ToColor = colorSettings.ToColor; base.ApplySettings(settings); }
public static UIColorAnimation ColorAnimation(this IUIColored obj, UIColorAnimationSettings settings) { return(obj.Animation <UIColorAnimation>(settings)); }