+ else
+ {
+ Animate(view, path, forward, alphaFunction, time);
+ }
+ }
+
+ /// <summary>
+ /// Creates an initialized animation.<br />
+ /// The animation will not loop.<br />
+ /// The default end action is "Cancel".<br />
+ /// The default alpha function is linear.<br />
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public Animation() : this(Interop.Animation.Animation_New(0.0f), true)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// Plays the animation.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public void Play()
+ {
+ Interop.Animation.Animation_Play(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ if (DisableAnimation == true)
+ Stop(EndActions.StopFinal);
+ }
+
+ /// <summary>
+ /// Plays the animation from a given point.<br />
+ /// The progress must be in the 0-1 interval or in the play range interval if defined,
+ /// otherwise, it will be ignored.<br />
+ /// </summary>
+ /// <param name="progress">A value between [0,1], or between the play range if specified, from where the animation should start playing.</param>
+ /// <since_tizen> 3 </since_tizen>
+ public void PlayFrom(float progress)
+ {
+ Interop.Animation.Animation_PlayFrom(swigCPtr, progress);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// Plays the animation after a given delay time.<br/>
+ /// The delay time is not included in the looping time.<br/>
+ /// When the delay time is a negative value, it would treat as play immediately.<br/>
+ /// </summary>
+ /// <param name="delayMilliseconds">The delay time.</param>
+ /// <since_tizen> 4 </since_tizen>
+ public void PlayAfter(int delayMilliseconds)
+ {
+ Interop.Animation.Animation_PlayAfter(swigCPtr, MilliSecondsToSeconds(delayMilliseconds));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// Pauses the animation.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public void Pause()
+ {
+ Interop.Animation.Animation_Pause(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// Stops the animation.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public void Stop()
+ {
+ Interop.Animation.Animation_Stop(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// Clears the animation.<br />
+ /// This disconnects any objects that were being animated, effectively stopping the animation.<br />
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public void Clear()
+ {
+ Interop.Animation.Animation_Clear(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Animation obj)
+ {
+ return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+ }
+
+ internal object ConvertTo(object value, Type toType)
+ {
+ Func<object> getConverter = () =>
+ {
+ string converterTypeName = GetTypeConverterTypeName(toType.GetTypeInfo().CustomAttributes);
+ if (converterTypeName == null)
+ return null;
+
+ Type convertertype = Type.GetType(converterTypeName);
+ return Activator.CreateInstance(convertertype);
+ };
+
+ return ConvertTo(value, toType, getConverter);
+ }
+
+ internal object ConvertTo(object value, Type toType, Func<object> getConverter)
+ {
+ if (value == null)
+ return null;
+
+ var str = value as string;
+ if (str != null)
+ {
+ //If there's a [TypeConverter], use it
+ object converter = getConverter?.Invoke();
+ var xfTypeConverter = converter as Tizen.NUI.Binding.TypeConverter;
+ if (xfTypeConverter != null)
+ return value = xfTypeConverter.ConvertFromInvariantString(str);
+ var converterType = converter?.GetType();
+ if (converterType != null)
+ {
+ var convertFromStringInvariant = converterType.GetRuntimeMethod("ConvertFromInvariantString",
+ new[] { typeof(string) });
+ if (convertFromStringInvariant != null)
+ return value = convertFromStringInvariant.Invoke(converter, new object[] { str });
+ }
+
+ //If the type is nullable, as the value is not null, it's safe to assume we want the built-in conversion
+ if (toType.GetTypeInfo().IsGenericType && toType.GetGenericTypeDefinition() == typeof(Nullable<>))
+ toType = Nullable.GetUnderlyingType(toType);
+
+ //Obvious Built-in conversions
+ if (toType.GetTypeInfo().IsEnum)
+ return Enum.Parse(toType, str, true);
+ if (toType == typeof(SByte))
+ return SByte.Parse(str, CultureInfo.InvariantCulture);
+ if (toType == typeof(Int16))
+ return Int16.Parse(str, CultureInfo.InvariantCulture);
+ if (toType == typeof(Int32))
+ return Int32.Parse(str, CultureInfo.InvariantCulture);
+ if (toType == typeof(Int64))
+ return Int64.Parse(str, CultureInfo.InvariantCulture);
+ if (toType == typeof(Byte))
+ return Byte.Parse(str, CultureInfo.InvariantCulture);
+ if (toType == typeof(UInt16))
+ return UInt16.Parse(str, CultureInfo.InvariantCulture);
+ if (toType == typeof(UInt32))
+ return UInt32.Parse(str, CultureInfo.InvariantCulture);
+ if (toType == typeof(UInt64))
+ return UInt64.Parse(str, CultureInfo.InvariantCulture);
+ if (toType == typeof(Single))
+ return Single.Parse(str, CultureInfo.InvariantCulture);
+ if (toType == typeof(Double))
+ return Double.Parse(str, CultureInfo.InvariantCulture);
+ if (toType == typeof(Boolean))
+ return Boolean.Parse(str);
+ if (toType == typeof(TimeSpan))
+ return TimeSpan.Parse(str, CultureInfo.InvariantCulture);
+ if (toType == typeof(DateTime))
+ return DateTime.Parse(str, CultureInfo.InvariantCulture);
+ if (toType == typeof(Char))
+ {
+ char c = '\0';
+ Char.TryParse(str, out c);
+ return c;
+ }
+ if (toType == typeof(String) && str.StartsWith("{}", StringComparison.Ordinal))
+ return str.Substring(2);
+ if (toType == typeof(String))
+ return value;
+ if (toType == typeof(Decimal))
+ return Decimal.Parse(str, CultureInfo.InvariantCulture);
+ }
+
+ //if the value is not assignable and there's an implicit conversion, convert
+ if (value != null && !toType.IsAssignableFrom(value.GetType()))