[NUI] Make ReleaseSwigCPtr didn't check HasBody()
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Animation / Animation.cs
1 /*
2  * Copyright(c) 2021 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 namespace Tizen.NUI
19 {
20     using System;
21     using System.ComponentModel;
22     using System.Runtime.InteropServices;
23     using System.Collections.Generic;
24     using System.Linq;
25     using System.Reflection;
26     using System.Globalization;
27     using System.Diagnostics.CodeAnalysis;
28
29     using Tizen.NUI.BaseComponents;
30
31     /// <summary>
32     /// Animation can be used to animate the properties of any number of objects, typically view.<br />
33     /// If the "Finished" event is connected to a member function of an object, it must be disconnected before the object is destroyed.<br />
34     /// This is typically done in the object destructor, and requires either the animation handle to be stored.<br />
35     /// The overall animation time is superseded by the values given in the animation time used when calling the AnimateTo(), AnimateBy(), AnimateBetween() and AnimatePath() methods.<br />
36     /// If any of the individual calls to those functions exceeds the overall animation time (Duration), then the overall animation time is automatically extended.<br />
37     /// </summary>
38     /// <since_tizen> 3 </since_tizen>
39     public class Animation : BaseHandle
40     {
41         private static bool? disableAnimation = null;
42
43         private AnimationFinishedEventCallbackType animationFinishedEventCallback;
44         private System.IntPtr finishedCallbackOfNative;
45
46         private AnimationProgressReachedEventCallbackType animationProgressReachedEventCallback;
47
48         private string[] properties = null;
49         private string[] destValue = null;
50         private int[] startTime = null;
51         private int[] endTime = null;
52
53         private List<string> propertyList = null;
54         private List<string> destValueList = null;
55         private List<int> startTimeList = null;
56         private List<int> endTimeList = null;
57
58         /// <summary>
59         /// Creates an initialized animation.<br />
60         /// The animation will not loop.<br />
61         /// The default end action is "Cancel".<br />
62         /// The default alpha function is linear.<br />
63         /// </summary>
64         /// <remarks>DurationmSeconds must be greater than zero.</remarks>
65         /// <param name="durationMilliSeconds">The duration in milliseconds.</param>
66         /// <since_tizen> 3 </since_tizen>
67         public Animation(int durationMilliSeconds) : this(Interop.Animation.New((float)durationMilliSeconds / 1000.0f), true)
68         {
69             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
70         }
71
72         internal Animation(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
73         {
74             animationFinishedEventCallback = OnFinished;
75             finishedCallbackOfNative = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(animationFinishedEventCallback);
76         }
77
78         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
79         private delegate void AnimationFinishedEventCallbackType(IntPtr data);
80
81         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
82         private delegate void AnimationProgressReachedEventCallbackType(IntPtr data);
83
84         private event EventHandler animationFinishedEventHandler;
85
86         /**
87         * @brief Event for the finished signal which can be used to subscribe or unsubscribe the event handler.
88         * The finished signal is emitted when an animation's animations have finished.
89         */
90         /// <since_tizen> 3 </since_tizen>
91         public event EventHandler Finished
92         {
93             add
94             {
95                 if (animationFinishedEventHandler == null && disposed == false)
96                 {
97                     AnimationSignal finishedSignal = FinishedSignal();
98                     finishedSignal.Connect(finishedCallbackOfNative);
99                     finishedSignal.Dispose();
100                 }
101                 animationFinishedEventHandler += value;
102             }
103             remove
104             {
105                 animationFinishedEventHandler -= value;
106
107                 AnimationSignal finishedSignal = FinishedSignal();
108                 if (animationFinishedEventHandler == null && finishedSignal.Empty() == false)
109                 {
110                     finishedSignal.Disconnect(finishedCallbackOfNative);
111                 }
112                 finishedSignal.Dispose();
113             }
114         }
115
116         private event EventHandler animationProgressReachedEventHandler;
117
118         /**
119        * @brief Event for the ProgressReached signal, which can be used to subscribe or unsubscribe the event handler.
120        * The ProgressReached signal is emitted when the animation has reached a given progress percentage, this is set in the api SetProgressNotification.
121        */
122         /// <since_tizen> 3 </since_tizen>
123         public event EventHandler ProgressReached
124         {
125             add
126             {
127                 if (animationProgressReachedEventHandler == null)
128                 {
129                     animationProgressReachedEventCallback = OnProgressReached;
130                     AnimationSignal progressReachedSignal = ProgressReachedSignal();
131                     progressReachedSignal?.Connect(animationProgressReachedEventCallback);
132                     progressReachedSignal?.Dispose();
133                 }
134
135                 animationProgressReachedEventHandler += value;
136             }
137             remove
138             {
139                 animationProgressReachedEventHandler -= value;
140
141                 AnimationSignal progressReachedSignal = ProgressReachedSignal();
142                 if (animationProgressReachedEventHandler == null && progressReachedSignal?.Empty() == false)
143                 {
144                     progressReachedSignal?.Disconnect(animationProgressReachedEventCallback);
145                 }
146                 progressReachedSignal.Dispose();
147             }
148         }
149
150         /// <summary>
151         /// Enumeration for what to do when the animation ends, stopped, or destroyed.
152         /// </summary>
153         /// <since_tizen> 3 </since_tizen>
154         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1717:Only FlagsAttribute enums should have plural names")]
155         public enum EndActions
156         {
157             /// <summary>
158             /// When the animation ends, the animated property values are saved.
159             /// </summary>
160             Cancel,
161             /// <summary>
162             /// When the animation ends, the animated property values are forgotten.
163             /// </summary>
164             Discard,
165             /// <summary>
166             /// If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like cancel.
167             /// </summary>
168             StopFinal
169         }
170
171         /// <summary>
172         /// Enumeration for what interpolation method to use on key-frame animations.
173         /// </summary>
174         /// <since_tizen> 3 </since_tizen>
175         public enum Interpolation
176         {
177             /// <summary>
178             /// Values in between key frames are interpolated using a linear polynomial. (Default)
179             /// </summary>
180             Linear,
181             /// <summary>
182             /// Values in between key frames are interpolated using a cubic polynomial.
183             /// </summary>
184             Cubic
185         }
186
187         /// <summary>
188         /// Enumeration for what state the animation is in.
189         /// </summary>
190         /// <remarks>Calling Reset() on this class will not reset the animation. It will call the BaseHandle.Reset() which drops the object handle.</remarks>
191         /// <since_tizen> 3 </since_tizen>
192         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1717:Only FlagsAttribute enums should have plural names")]
193         public enum States
194         {
195             /// <summary>
196             /// The animation has stopped.
197             /// </summary>
198             Stopped,
199             /// <summary>
200             /// The animation is playing.
201             /// </summary>
202             Playing,
203             /// <summary>
204             /// The animation is paused.
205             /// </summary>
206             Paused
207         }
208
209         /// <summary>
210         /// Gets or sets the duration in milliseconds of the animation.
211         /// This duration is applied to the animations are added after the Duration is set.
212         /// </summary>
213         /// <example>
214         /// <code>
215         /// animation.AnimateTo(actor, "position", destination);
216         /// animation.Duration = 500; // This duration 500 is only applied to the size animation.
217         /// animation.AnimateTo(actor, "size", size);
218         /// </code>
219         /// </example>
220         /// <since_tizen> 3 </since_tizen>
221         public int Duration
222         {
223             set
224             {
225                 SetDuration(MilliSecondsToSeconds(value));
226             }
227             get
228             {
229                 return SecondsToMilliSeconds(GetDuration());
230             }
231         }
232
233         /// <summary>
234         /// Gets or sets the default alpha function for the animation.
235         /// This DefaultAlphaFunction is only applied to the animations are added after the DefaultAlphaFunction is set.
236         /// </summary>
237         /// <example>
238         /// <code>
239         /// animation.AnimateTo(actor, "position", destination);
240         /// animation.DefaultAlphaFunction = newAlphaFunction; // This newAlphaFunction is applied only for the size animation.
241         /// animation.AnimateTo(actor, "size", size);
242         /// </code>
243         /// </example>
244         /// <since_tizen> 3 </since_tizen>
245         public AlphaFunction DefaultAlphaFunction
246         {
247             set
248             {
249                 SetDefaultAlphaFunction(value);
250             }
251             get
252             {
253                 AlphaFunction ret = GetDefaultAlphaFunction();
254                 return ret;
255             }
256         }
257
258         /// <summary>
259         /// Queries the state of the animation.
260         /// </summary>
261         /// <since_tizen> 3 </since_tizen>
262         public States State
263         {
264             get
265             {
266                 return GetState();
267             }
268         }
269
270         /// <summary>
271         /// Set: Enables looping for a specified number of repeats. A zero is the same as Looping = true; i.e., repeat forever.<br />
272         /// This property resets the looping value and should not be used with the Looping property.<br />
273         /// Setting this parameter does not cause the animation to Play().<br />
274         /// Get: Gets the loop count. A zero is the same as Looping = true; i.e., repeat forever.<br />
275         /// The loop count is initially 1 for play once.<br />
276         /// </summary>
277         /// <since_tizen> 3 </since_tizen>
278         public int LoopCount
279         {
280             set
281             {
282                 SetLoopCount(value);
283             }
284             get
285             {
286                 int ret = GetLoopCount();
287                 return ret;
288             }
289         }
290
291         /// <summary>
292         /// Gets or sets the status of whether the animation will loop.<br />
293         /// This property resets the loop count and should not be used with the LoopCount property.<br />
294         /// Setting this parameter does not cause the animation to Play().<br />
295         /// </summary>
296         /// <since_tizen> 3 </since_tizen>
297         public bool Looping
298         {
299             set
300             {
301                 SetLooping(value);
302             }
303             get
304             {
305                 bool ret = IsLooping();
306                 return ret;
307             }
308         }
309
310
311         /// <summary>
312         /// Gets or sets the end action of the animation.<br />
313         /// This action is performed when the animation ends or if it is stopped.<br />
314         /// The default end action is cancel.<br />
315         /// </summary>
316         /// <since_tizen> 3 </since_tizen>
317         public EndActions EndAction
318         {
319             set
320             {
321                 SetEndAction(value);
322             }
323             get
324             {
325                 return GetEndAction();
326             }
327         }
328
329         /// <summary>
330         /// Gets the current loop count.<br />
331         /// A value 0 indicating the current loop count when looping.<br />
332         /// </summary>
333         /// <since_tizen> 3 </since_tizen>
334         public int CurrentLoop
335         {
336             get
337             {
338                 return GetCurrentLoop();
339             }
340         }
341
342         /// <summary>
343         /// Gets or sets the disconnect action.<br />
344         /// If any of the animated property owners are disconnected from the stage while the animation is being played, then this action is performed.<br />
345         /// The default action is cancel.<br />
346         /// </summary>
347         /// <since_tizen> 3 </since_tizen>
348         public EndActions DisconnectAction
349         {
350             set
351             {
352                 Interop.Animation.SetDisconnectAction(SwigCPtr, (int)value);
353                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
354             }
355             get
356             {
357                 Animation.EndActions ret = (Animation.EndActions)Interop.Animation.GetDisconnectAction(SwigCPtr);
358                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
359                 return ret;
360             }
361         }
362
363
364         /// <summary>
365         /// Gets or sets the progress of the animation.<br />
366         /// The animation will play (or continue playing) from this point.<br />
367         /// The progress must be in the 0-1 interval or in the play range interval if defined<br />
368         /// otherwise, it will be ignored.<br />
369         /// </summary>
370         /// <since_tizen> 3 </since_tizen>
371         public float CurrentProgress
372         {
373             set
374             {
375                 Interop.Animation.SetCurrentProgress(SwigCPtr, value);
376                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
377             }
378             get
379             {
380                 float ret = Interop.Animation.GetCurrentProgress(SwigCPtr);
381                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
382                 return ret;
383             }
384         }
385
386         /// <summary>
387         /// Gets or sets specifications of a speed factor for the animation.<br />
388         /// The speed factor is a multiplier of the normal velocity of the animation.<br />
389         /// Values between [0, 1] will slow down the animation and values above one will speed up the animation.<br />
390         /// It is also possible to specify a negative multiplier to play the animation in reverse.<br />
391         /// </summary>
392         /// <since_tizen> 3 </since_tizen>
393         public float SpeedFactor
394         {
395             set
396             {
397                 Interop.Animation.SetSpeedFactor(SwigCPtr, value);
398                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
399             }
400             get
401             {
402                 float ret = Interop.Animation.GetSpeedFactor(SwigCPtr);
403                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
404                 return ret;
405             }
406         }
407
408         /// <summary>
409         /// Gets or sets the playing range.<br />
410         /// Animation will play between the values specified. Both values (range.x and range.y ) should be between 0-1,
411         /// otherwise they will be ignored. If the range provided is not in proper order (minimum, maximum ), it will be reordered.<br />
412         /// </summary>
413         /// <since_tizen> 3 </since_tizen>
414         public RelativeVector2 PlayRange
415         {
416             set
417             {
418                 Interop.Animation.SetPlayRange(SwigCPtr, Vector2.getCPtr(value));
419                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
420             }
421             get
422             {
423                 Vector2 ret = new Vector2(Interop.Animation.GetPlayRange(SwigCPtr), true);
424                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
425                 return ret;
426             }
427         }
428
429
430         /// <summary>
431         /// Gets or sets the progress notification marker which triggers the ProgressReachedSignal.<br />
432         /// Percentage of animation progress should be greater than 0 and less than 1, for example, 0.3 for 30% <br />
433         /// One notification can be set on each animation.
434         /// </summary>
435         /// <since_tizen> 3 </since_tizen>
436         public float ProgressNotification
437         {
438             set
439             {
440                 Interop.Animation.SetProgressNotification(SwigCPtr, value);
441                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
442             }
443             get
444             {
445                 float ret = Interop.Animation.GetProgressNotification(SwigCPtr);
446                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
447                 return ret;
448             }
449         }
450
451         /// <summary>
452         /// Gets or sets the properties of the animation.
453         /// </summary>
454         //ToDo : will raise deprecated-ACR, [Obsolete("Deprecated in API9, will be removed in API11, Use PropertyList instead")]
455         [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "This API will be deprecated, so suppressing the warning for now")]
456         public string[] Properties
457         {
458             get
459             {
460                 return properties;
461             }
462             set
463             {
464                 properties = value;
465             }
466         }
467
468         /// <summary>
469         /// Gets or sets the destination value for each property of the animation.
470         /// </summary>
471         //ToDo : will raise deprecated-ACR, [Obsolete("Deprecated in API9, will be removed in API11, Use DestValueList instead")]
472         [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "This API will be deprecated, so suppressing the warning for now")]
473         public string[] DestValue
474         {
475             get
476             {
477                 return destValue;
478             }
479             set
480             {
481                 destValue = value;
482             }
483         }
484
485         /// <summary>
486         /// Gets or sets the start time for each property of the animation.
487         /// </summary>
488         //ToDo : will raise deprecated-ACR, [Obsolete("Deprecated in API9, will be removed in API11, Use StartTimeList instead")]
489         [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "This API will be deprecated, so suppressing the warning for now")]
490         public int[] StartTime
491         {
492             get
493             {
494                 return startTime;
495             }
496             set
497             {
498                 startTime = value;
499             }
500         }
501
502         /// <summary>
503         /// Gets or sets the end time for each property of the animation.
504         /// </summary>
505         //ToDo : will raise deprecated-ACR, [Obsolete("Deprecated in API9, will be removed in API11, Use EndTimeList instead")]
506         [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "This API will be deprecated, so suppressing the warning for now")]
507         public int[] EndTime
508         {
509             get
510             {
511                 return endTime;
512             }
513             set
514             {
515                 endTime = value;
516             }
517         }
518
519         /// <summary>
520         /// Get the list of the properties of the animation.
521         /// </summary>
522         [EditorBrowsable(EditorBrowsableState.Never)]
523         public IList<string> PropertyList
524         {
525             get
526             {
527                 if (null == propertyList)
528                 {
529                     propertyList = new List<string>();
530                 }
531
532                 return propertyList;
533             }
534         }
535
536         /// <summary>
537         /// Get the list of the destination value for each property of the animation.
538         /// </summary>
539         [EditorBrowsable(EditorBrowsableState.Never)]
540         public IList<string> DestValueList
541         {
542             get
543             {
544                 if (null == destValueList)
545                 {
546                     destValueList = new List<string>();
547                 }
548
549                 return destValueList;
550             }
551         }
552
553         /// <summary>
554         /// Get the list of the start time for each property of the animation.
555         /// </summary>
556         [EditorBrowsable(EditorBrowsableState.Never)]
557         public IList<int> StartTimeList
558         {
559             get
560             {
561                 if (null == startTimeList)
562                 {
563                     startTimeList = new List<int>();
564                 }
565
566                 return startTimeList;
567             }
568         }
569
570         /// <summary>
571         /// Get the list of end time for each property of the animation.
572         /// </summary>
573         [EditorBrowsable(EditorBrowsableState.Never)]
574         public IList<int> EndTimeList
575         {
576             get
577             {
578                 if (null == endTimeList)
579                 {
580                     endTimeList = new List<int>();
581                 }
582
583                 return endTimeList;
584             }
585         }
586
587         private bool DisableAnimation
588         {
589             get
590             {
591                 if (disableAnimation.HasValue == false)
592                 {
593                     string type = Environment.GetEnvironmentVariable("PlatformSmartType");
594                     if (type == "Entry")
595                         disableAnimation = true;
596                     else
597                         disableAnimation = false;
598                 }
599                 return disableAnimation.Value;
600             }
601         }
602
603         /// <summary>
604         /// Downcasts a handle to animation handle.<br />
605         /// If handle points to an animation object, the downcast produces a valid handle.<br />
606         /// If not, the returned handle is left uninitialized.<br />
607         /// </summary>
608         /// <param name="handle">Handle to an object.</param>
609         /// <returns>Handle to an animation object or an uninitialized handle.</returns>
610         /// <exception cref="ArgumentNullException"> Thrown when handle is null. </exception>
611         internal static Animation DownCast(BaseHandle handle)
612         {
613             if (handle == null)
614             {
615                 throw new ArgumentNullException(nameof(handle));
616             }
617             Animation ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Animation;
618             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
619             return ret;
620         }
621
622         /// <summary>
623         /// Stops the animation.
624         /// </summary>
625         /// <param name="action">The end action can be set.</param>
626         /// <since_tizen> 3 </since_tizen>
627         public void Stop(EndActions action = EndActions.Cancel)
628         {
629             SetEndAction(action);
630             Interop.Animation.Stop(SwigCPtr);
631             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
632         }
633
634         /// <summary>
635         /// Animates a property value by a relative amount.<br />
636         /// </summary>
637         /// <param name="target">The target animatable object to animate.</param>
638         /// <param name="property">The target property to animate.</param>
639         /// <param name="relativeValue">The property value will change by this amount.</param>
640         /// <param name="alphaFunction">The alpha function to apply.</param>
641         /// <exception cref="ArgumentNullException"> Thrown when target or property or relativeValue is null. </exception>
642         /// <exception cref="ArgumentException"> Thrown when it failed to find a property from given string or the given relativeValue is invalid format. </exception>
643         /// This will not be public opened.
644         [EditorBrowsable(EditorBrowsableState.Never)]
645         public void AnimateBy(Animatable target, string property, object relativeValue, AlphaFunction alphaFunction = null)
646         {
647             if (target == null)
648             {
649                 throw new ArgumentNullException(nameof(target));
650             }
651             if (property == null)
652             {
653                 throw new ArgumentNullException(nameof(property));
654             }
655             if (relativeValue == null)
656             {
657                 throw new ArgumentNullException(nameof(relativeValue));
658             }
659
660             using (var result = PropertyHelper.Search(target, property))
661             {
662                 if (result == null)
663                 {
664                     throw new ArgumentException("string property is invalid");
665                 }
666
667                 var current = result;
668                 while (current != null)
669                 {
670
671                     var targetValueIntPtr = current.RefineValueIntPtr(relativeValue);
672                     if (targetValueIntPtr == global::System.IntPtr.Zero)
673                     {
674                         throw new ArgumentException("Invalid " + nameof(relativeValue));
675                     }
676                     AnimateByIntPtr(current.Property, targetValueIntPtr, alphaFunction);
677                     Interop.PropertyValue.DeletePropertyValueIntPtr(targetValueIntPtr);
678                     current = current.NextResult;
679                 }
680             }
681         }
682
683         /// <summary>
684         /// Animates a property value by a relative amount.<br />
685         /// </summary>
686         /// <param name="target">The target animatable object to animate.</param>
687         /// <param name="property">The target property to animate.</param>
688         /// <param name="relativeValue">The property value will change by this amount.</param>
689         /// <param name="startTime">The start time of the animation.</param>
690         /// <param name="endTime">The end time of the animation.</param>
691         /// <param name="alphaFunction">The alpha function to apply.</param>
692         /// <exception cref="ArgumentNullException"> Thrown when target or property or relativeValue is null. </exception>
693         /// <exception cref="ArgumentException"> Thrown when it failed to find a property from given string or the given relativeValue is invalid format. </exception>
694         /// This will not be public opened.
695         [EditorBrowsable(EditorBrowsableState.Never)]
696         public void AnimateBy(Animatable target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
697         {
698             if (target == null)
699             {
700                 throw new ArgumentNullException(nameof(target));
701             }
702             if (property == null)
703             {
704                 throw new ArgumentNullException(nameof(property));
705             }
706             if (relativeValue == null)
707             {
708                 throw new ArgumentNullException(nameof(relativeValue));
709             }
710
711             using (var result = PropertyHelper.Search(target, property))
712             {
713                 if (result == null)
714                 {
715                     throw new ArgumentException("string property is invalid");
716                 }
717
718                 var current = result;
719                 using (var time = new TimePeriod(startTime, endTime - startTime))
720                     while (current != null)
721                     {
722
723                         var targetValueIntPtr = current.RefineValueIntPtr(relativeValue);
724                         if (targetValueIntPtr == global::System.IntPtr.Zero)
725                         {
726                             throw new ArgumentException("Invalid " + nameof(relativeValue));
727                         }
728                         AnimateByIntPtr(current.Property, targetValueIntPtr, alphaFunction, time);
729                         Interop.PropertyValue.DeletePropertyValueIntPtr(targetValueIntPtr);
730                         current = current.NextResult;
731                     }
732             }
733         }
734
735         /// <summary>
736         /// Animates a property value by a relative amount.<br />
737         /// </summary>
738         /// <param name="target">The target object to animate.</param>
739         /// <param name="property">The target property to animate.</param>
740         /// <param name="relativeValue">The property value will change by this amount.</param>
741         /// <param name="alphaFunction">The alpha function to apply.</param>
742         /// <exception cref="ArgumentNullException"> Thrown when target or property or relativeValue is null. </exception>
743         /// <exception cref="ArgumentException"> Thrown when it failed to find a property from given string or the given relativeValue is invalid format. </exception>
744         /// <since_tizen> 3 </since_tizen>
745         public void AnimateBy(View target, string property, object relativeValue, AlphaFunction alphaFunction = null)
746         {
747             AnimateBy(target as Animatable, property, relativeValue, alphaFunction);
748         }
749
750         /// <summary>
751         /// Animates a property value by a relative amount.<br />
752         /// </summary>
753         /// <param name="target">The target object to animate.</param>
754         /// <param name="property">The target property to animate.</param>
755         /// <param name="relativeValue">The property value will change by this amount.</param>
756         /// <param name="startTime">The start time of the animation.</param>
757         /// <param name="endTime">The end time of the animation.</param>
758         /// <param name="alphaFunction">The alpha function to apply.</param>
759         /// <exception cref="ArgumentNullException"> Thrown when target or property or relativeValue is null. </exception>
760         /// <exception cref="ArgumentException"> Thrown when it failed to find a property from given string or the given relativeValue is invalid format. </exception>
761         /// <since_tizen> 3 </since_tizen>
762         public void AnimateBy(View target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
763         {
764             AnimateBy(target as Animatable, property, relativeValue, startTime, endTime, alphaFunction);
765         }
766
767         /// <summary>
768         /// Animates a property to a destination value.<br />
769         /// </summary>
770         /// <param name="target">The target animatable object to animate.</param>
771         /// <param name="property">The target property to animate.</param>
772         /// <param name="destinationValue">The destination value.</param>
773         /// <param name="alphaFunction">The alpha function to apply.</param>
774         /// <exception cref="ArgumentNullException"> Thrown when target or property or destinationValue is null. </exception>
775         /// <exception cref="ArgumentException"> Thrown when it failed to find a property from given string or the given destinationValue is invalid format. </exception>
776         /// This will not be public opened.
777         [EditorBrowsable(EditorBrowsableState.Never)]
778         public void AnimateTo(Animatable target, string property, object destinationValue, AlphaFunction alphaFunction = null)
779         {
780             if (target == null)
781             {
782                 throw new ArgumentNullException(nameof(target));
783             }
784             if (property == null)
785             {
786                 throw new ArgumentNullException(nameof(property));
787             }
788             if (destinationValue == null)
789             {
790                 throw new ArgumentNullException(nameof(destinationValue));
791             }
792
793             using (var result = PropertyHelper.Search(target, property))
794             {
795                 if (result == null)
796                 {
797                     throw new ArgumentException("string property is invalid");
798                 }
799
800                 var current = result;
801                 while (current != null)
802                 {
803
804                     var targetValueIntPtr = current.RefineValueIntPtr(destinationValue);
805                     if (targetValueIntPtr == global::System.IntPtr.Zero)
806                     {
807                         throw new ArgumentException("Invalid " + nameof(destinationValue));
808                     }
809                     AnimateToIntPtr(current.Property, targetValueIntPtr, alphaFunction);
810                     Interop.PropertyValue.DeletePropertyValueIntPtr(targetValueIntPtr);
811                     current = current.NextResult;
812                 }
813             }
814         }
815
816         /// <summary>
817         /// Animates a property to a destination value.<br />
818         /// </summary>
819         /// <param name="target">The target animatable object to animate.</param>
820         /// <param name="property">The target property to animate.</param>
821         /// <param name="destinationValue">The destination value.</param>
822         /// <param name="startTime">The start time of the animation.</param>
823         /// <param name="endTime">The end time of the animation.</param>
824         /// <param name="alphaFunction">The alpha function to apply.</param>
825         /// <exception cref="ArgumentNullException"> Thrown when target or property or destinationValue is null. </exception>
826         /// <exception cref="ArgumentException"> Thrown when it failed to find a property from given string or the given destinationValue is invalid format. </exception>
827         /// This will not be public opened.
828         [EditorBrowsable(EditorBrowsableState.Never)]
829         public void AnimateTo(Animatable target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
830         {
831             if (target == null)
832             {
833                 throw new ArgumentNullException(nameof(target));
834             }
835             if (property == null)
836             {
837                 throw new ArgumentNullException(nameof(property));
838             }
839             if (destinationValue == null)
840             {
841                 throw new ArgumentNullException(nameof(destinationValue));
842             }
843
844             using (var result = PropertyHelper.Search(target, property))
845             {
846                 if (result == null)
847                 {
848                     throw new ArgumentException("string property is invalid");
849                 }
850
851                 var current = result;
852                 using (var time = new TimePeriod(startTime, endTime - startTime))
853                     while (current != null)
854                     {
855 #if NUI_ANIMATION_PROPERTY_CHANGE_1
856                         var targetValueIntPtr = current.RefineValueIntPtr(destinationValue);
857                         if (targetValueIntPtr == global::System.IntPtr.Zero)
858                         {
859                             throw new ArgumentException("Invalid " + nameof(destinationValue));
860                         }
861                         AnimateToIntPtr(current.Property, targetValueIntPtr, alphaFunction, time);
862                         Interop.PropertyValue.DeletePropertyValueIntPtr(targetValueIntPtr);
863 #else
864                         var targetValue = current.RefineValue(destinationValue) ?? throw new ArgumentException("Invalid " + nameof(destinationValue));
865                         AnimateTo(current.Property, targetValue, alphaFunction, time);
866                         targetValue.Dispose();
867 #endif
868                         current = current.NextResult;
869                     }
870             }
871         }
872
873         /// <summary>
874         /// Animates a property to a destination value.<br />
875         /// </summary>
876         /// <param name="target">The target object to animate.</param>
877         /// <param name="property">The target property to animate.</param>
878         /// <param name="destinationValue">The destination value.</param>
879         /// <param name="alphaFunction">The alpha function to apply.</param>
880         /// <exception cref="ArgumentNullException"> Thrown when target or property or destinationValue is null. </exception>
881         /// <exception cref="ArgumentException"> Thrown when it failed to find a property from given string or the given destinationValue is invalid format. </exception>
882         /// <since_tizen> 3 </since_tizen>
883         public void AnimateTo(View target, string property, object destinationValue, AlphaFunction alphaFunction = null)
884         {
885             AnimateTo(target as Animatable, property, destinationValue, alphaFunction);
886         }
887
888         /// <summary>
889         /// Animates a property to a destination value.<br />
890         /// </summary>
891         /// <param name="target">The target object to animate.</param>
892         /// <param name="property">The target property to animate.</param>
893         /// <param name="destinationValue">The destination value.</param>
894         /// <param name="startTime">The start time of the animation.</param>
895         /// <param name="endTime">The end time of the animation.</param>
896         /// <param name="alphaFunction">The alpha function to apply.</param>
897         /// <exception cref="ArgumentNullException"> Thrown when target or property or destinationValue is null. </exception>
898         /// <exception cref="ArgumentException"> Thrown when it failed to find a property from given string or the given destinationValue is invalid format. </exception>
899         /// <since_tizen> 3 </since_tizen>
900         public void AnimateTo(View target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
901         {
902             AnimateTo(target as Animatable, property, destinationValue, startTime, endTime, alphaFunction);
903         }
904
905         /// <summary>
906         /// Animates one or more properties to a destination value.<br />
907         /// </summary>
908         /// <param name="target">The target object to animate.</param>
909         /// <exception cref="ArgumentNullException"> Thrown when target is null. </exception>
910         public void PlayAnimateTo(View target)
911         {
912             if (target == null)
913             {
914                 throw new ArgumentNullException(nameof(target));
915             }
916
917             Clear();
918
919             if (null != propertyList && null != destValueList && null != startTimeList && null != endTimeList)
920             {
921                 if (propertyList.Count == destValueList.Count
922                     &&
923                     startTimeList.Count == endTimeList.Count
924                     &&
925                     propertyList.Count == startTimeList.Count)
926                 {
927                     int count = propertyList.Count;
928                     for (int index = 0; index < count; index++)
929                     {
930                         var elementType = target.GetType();
931                         PropertyInfo propertyInfo = elementType.GetProperties().FirstOrDefault(fi => fi.Name == propertyList[index]);
932
933                         if (propertyInfo != null)
934                         {
935                             object destinationValue = ConvertTo(destValueList[index], propertyInfo.PropertyType);
936
937                             if (destinationValue != null)
938                             {
939                                 AnimateTo(target, propertyList[index], destinationValue, startTimeList[index], endTimeList[index]);
940                             }
941                         }
942                     }
943                     Play();
944                 }
945             }
946             else
947             {
948                 if (properties.Length == destValue.Length && startTime.Length == endTime.Length && properties.Length == startTime.Length)
949                 {
950                     int length = properties.Length;
951                     for (int index = 0; index < length; index++)
952                     {
953                         //object destinationValue = _destValue[index];
954                         var elementType = target.GetType();
955                         PropertyInfo propertyInfo = elementType.GetProperties().FirstOrDefault(fi => fi.Name == properties[index]);
956                         //var propertyInfo = elementType.GetRuntimeProperties().FirstOrDefault(p => p.Name == localName);
957                         if (propertyInfo != null)
958                         {
959                             object destinationValue = ConvertTo(destValue[index], propertyInfo.PropertyType);
960
961                             if (destinationValue != null)
962                             {
963                                 AnimateTo(target, properties[index], destinationValue, startTime[index], endTime[index]);
964                             }
965                         }
966                     }
967                     Play();
968                 }
969             }
970         }
971
972         /// <summary>
973         /// Animates a property between keyframes.
974         /// </summary>
975         /// <param name="target">The target animatable object to animate.</param>
976         /// <param name="property">The target property to animate.</param>
977         /// <param name="keyFrames">The set of time or value pairs between which to animate.</param>
978         /// <param name="interpolation">The method used to interpolate between values.</param>
979         /// <param name="alphaFunction">The alpha function to apply.</param>
980         /// <exception cref="ArgumentNullException"> Thrown when target or property or keyFrames is null. </exception>
981         /// <exception cref="ArgumentException"> Thrown when it failed to find a property from given string or the given keyFrames has invalid value. </exception>
982         /// This will not be public opened.
983         [EditorBrowsable(EditorBrowsableState.Never)]
984         public void AnimateBetween(Animatable target, string property, KeyFrames keyFrames, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
985         {
986             if (target == null)
987             {
988                 throw new ArgumentNullException(nameof(target));
989             }
990             if (property == null)
991             {
992                 throw new ArgumentNullException(nameof(property));
993             }
994             if (keyFrames == null)
995             {
996                 throw new ArgumentNullException(nameof(keyFrames));
997             }
998
999             using (var result = PropertyHelper.Search(target, property))
1000             {
1001                 if (result == null)
1002                 {
1003                     throw new ArgumentException("string property is invalid");
1004                 }
1005
1006                 var current = result;
1007                 while (current != null)
1008                 {
1009                     // NOTE Do not dispose keyFrames object returned by GetRefinedKeyFrames() here.
1010                     AnimateBetween(current.Property, current.RefineKeyFrames(keyFrames) ?? throw new ArgumentException("Invalid " + nameof(keyFrames)), alphaFunction, interpolation);
1011                     current = current.NextResult;
1012                 }
1013             }
1014         }
1015
1016         /// <summary>
1017         /// Animates a property between keyframes.
1018         /// </summary>
1019         /// <param name="target">The target animatable object to animate</param>
1020         /// <param name="property">The target property to animate</param>
1021         /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
1022         /// <param name="startTime">The start time of animation in milliseconds.</param>
1023         /// <param name="endTime">The end time of animation in milliseconds.</param>
1024         /// <param name="interpolation">The method used to interpolate between values.</param>
1025         /// <param name="alphaFunction">The alpha function to apply.</param>
1026         /// <exception cref="ArgumentNullException"> Thrown when target or property or keyFrames is null. </exception>
1027         /// <exception cref="ArgumentException"> Thrown when it failed to find a property from given string or the given keyFrames has invalid value. </exception>
1028         /// This will not be public opened.
1029         [EditorBrowsable(EditorBrowsableState.Never)]
1030         public void AnimateBetween(Animatable target, string property, KeyFrames keyFrames, int startTime, int endTime, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
1031         {
1032             if (target == null)
1033             {
1034                 throw new ArgumentNullException(nameof(target));
1035             }
1036             if (property == null)
1037             {
1038                 throw new ArgumentNullException(nameof(property));
1039             }
1040             if (keyFrames == null)
1041             {
1042                 throw new ArgumentNullException(nameof(keyFrames));
1043             }
1044
1045             using (var result = PropertyHelper.Search(target, property))
1046             {
1047                 if (result == null)
1048                 {
1049                     throw new ArgumentException("string property is invalid");
1050                 }
1051
1052                 var current = result;
1053                 using (var time = new TimePeriod(startTime, endTime - startTime))
1054                     while (current != null)
1055                     {
1056                         // NOTE Do not dispose keyFrames object returned by GetRefinedKeyFrames() here.
1057                         AnimateBetween(current.Property, current.RefineKeyFrames(keyFrames) ?? throw new ArgumentException("Invalid " + nameof(keyFrames)), alphaFunction, time, interpolation);
1058                         current = current.NextResult;
1059                     }
1060             }
1061         }
1062
1063         /// <summary>
1064         /// Animates a property between keyframes.
1065         /// </summary>
1066         /// <param name="target">The target object to animate.</param>
1067         /// <param name="property">The target property to animate.</param>
1068         /// <param name="keyFrames">The set of time or value pairs between which to animate.</param>
1069         /// <param name="interpolation">The method used to interpolate between values.</param>
1070         /// <param name="alphaFunction">The alpha function to apply.</param>
1071         /// <exception cref="ArgumentNullException"> Thrown when target or property or keyFrames is null. </exception>
1072         /// <exception cref="ArgumentException"> Thrown when it failed to find a property from given string or the given keyFrames has invalid value. </exception>
1073         /// <since_tizen> 3 </since_tizen>
1074         public void AnimateBetween(View target, string property, KeyFrames keyFrames, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
1075         {
1076             AnimateBetween(target as Animatable, property, keyFrames, interpolation, alphaFunction);
1077         }
1078
1079         /// <summary>
1080         /// Animates a property between keyframes.
1081         /// </summary>
1082         /// <param name="target">The target object to animate</param>
1083         /// <param name="property">The target property to animate</param>
1084         /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
1085         /// <param name="startTime">The start time of animation in milliseconds.</param>
1086         /// <param name="endTime">The end time of animation in milliseconds.</param>
1087         /// <param name="interpolation">The method used to interpolate between values.</param>
1088         /// <param name="alphaFunction">The alpha function to apply.</param>
1089         /// <exception cref="ArgumentNullException"> Thrown when target or property or keyFrames is null. </exception>
1090         /// <exception cref="ArgumentException"> Thrown when it failed to find a property from given string or the given keyFrames has invalid value. </exception>
1091         /// <since_tizen> 3 </since_tizen>
1092         public void AnimateBetween(View target, string property, KeyFrames keyFrames, int startTime, int endTime, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
1093         {
1094             AnimateBetween(target as Animatable, property, keyFrames, startTime, endTime, interpolation, alphaFunction);
1095         }
1096
1097         /// <summary>
1098         /// Animates the view's position and orientation through a predefined path.<br />
1099         /// The view will rotate to orient the supplied forward vector with the path's tangent.<br />
1100         /// If forward is the zero vector then no rotation will happen.<br />
1101         /// </summary>
1102         /// <param name="view">The view to animate.</param>
1103         /// <param name="path">It defines position and orientation.</param>
1104         /// <param name="forward">The vector (in local space coordinate system) will be oriented with the path's tangent direction.</param>
1105         /// <param name="alphaFunction">The alpha function to apply.</param>
1106         /// <since_tizen> 3 </since_tizen>
1107         public void AnimatePath(View view, Path path, Vector3 forward, AlphaFunction alphaFunction = null)
1108         {
1109             if (alphaFunction == null)
1110             {
1111                 Animate(view, path, forward);
1112             }
1113             else
1114             {
1115                 Animate(view, path, forward, alphaFunction);
1116             }
1117         }
1118
1119         /// <summary>
1120         /// Animates the view's position and orientation through a predefined path.<br />
1121         /// The view will rotate to orient the supplied forward vector with the path's tangent.<br />
1122         /// If forward is the zero vector then no rotation will happen.<br />
1123         /// </summary>
1124         /// <param name="view">The view to animate.</param>
1125         /// <param name="path">It defines position and orientation.</param>
1126         /// <param name="forward">The vector (in local space coordinate system) will be oriented with the path's tangent direction.</param>
1127         /// <param name="startTime">The start time of the animation.</param>
1128         /// <param name="endTime">The end time of the animation.</param>
1129         /// <param name="alphaFunction">The alpha function to apply.</param>
1130         /// <since_tizen> 3 </since_tizen>
1131         public void AnimatePath(View view, Path path, Vector3 forward, int startTime, int endTime, AlphaFunction alphaFunction = null)
1132         {
1133             TimePeriod time = new TimePeriod(startTime, endTime - startTime);
1134             if (alphaFunction == null)
1135             {
1136                 Animate(view, path, forward, time);
1137             }
1138             else
1139             {
1140                 Animate(view, path, forward, alphaFunction, time);
1141             }
1142             time.Dispose();
1143         }
1144
1145         /// <summary>
1146         /// Creates an initialized animation.<br />
1147         /// The animation will not loop.<br />
1148         /// The default end action is "Cancel".<br />
1149         /// The default alpha function is linear.<br />
1150         /// </summary>
1151         /// <since_tizen> 3 </since_tizen>
1152         public Animation() : this(Interop.Animation.New(0.0f), true)
1153         {
1154             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1155         }
1156
1157         /// <summary>
1158         /// Plays the animation.
1159         /// </summary>
1160         /// <since_tizen> 3 </since_tizen>
1161         public void Play()
1162         {
1163             Interop.Animation.Play(SwigCPtr);
1164             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1165
1166             if (DisableAnimation == true)
1167                 Stop(EndActions.StopFinal);
1168         }
1169
1170         /// <summary>
1171         /// Plays the animation from a given point.<br />
1172         /// The progress must be in the 0-1 interval or in the play range interval if defined,
1173         /// otherwise, it will be ignored.<br />
1174         /// </summary>
1175         /// <param name="progress">A value between [0,1], or between the play range if specified, from where the animation should start playing.</param>
1176         /// <since_tizen> 3 </since_tizen>
1177         public void PlayFrom(float progress)
1178         {
1179             Interop.Animation.PlayFrom(SwigCPtr, progress);
1180             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1181         }
1182
1183         /// <summary>
1184         /// Plays the animation after a given delay time.<br/>
1185         /// The delay time is not included in the looping time.<br/>
1186         /// When the delay time is a negative value, it would treat as play immediately.<br/>
1187         /// </summary>
1188         /// <param name="delayMilliseconds">The delay time.</param>
1189         /// <since_tizen> 4 </since_tizen>
1190         public void PlayAfter(int delayMilliseconds)
1191         {
1192             Interop.Animation.PlayAfter(SwigCPtr, MilliSecondsToSeconds(delayMilliseconds));
1193             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1194         }
1195
1196         /// <summary>
1197         /// Pauses the animation.
1198         /// </summary>
1199         /// <since_tizen> 3 </since_tizen>
1200         public void Pause()
1201         {
1202             Interop.Animation.Pause(SwigCPtr);
1203             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1204         }
1205
1206         /// <summary>
1207         /// Stops the animation.
1208         /// </summary>
1209         /// <since_tizen> 3 </since_tizen>
1210         public void Stop()
1211         {
1212             Interop.Animation.Stop(SwigCPtr);
1213             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1214         }
1215
1216         /// <summary>
1217         /// Clears the animation.<br />
1218         /// This disconnects any objects that were being animated, effectively stopping the animation.<br />
1219         /// </summary>
1220         /// <since_tizen> 3 </since_tizen>
1221         public void Clear()
1222         {
1223             Interop.Animation.Clear(SwigCPtr);
1224             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1225         }
1226
1227         internal object ConvertTo(object value, Type toType)
1228         {
1229             Func<object> getConverter = () =>
1230             {
1231                 string converterTypeName = GetTypeConverterTypeName(toType.GetTypeInfo().CustomAttributes);
1232                 if (converterTypeName == null)
1233                     return null;
1234
1235                 Type convertertype = Type.GetType(converterTypeName);
1236                 return Activator.CreateInstance(convertertype);
1237             };
1238
1239             return ConvertTo(value, toType, getConverter);
1240         }
1241
1242         internal object ConvertTo(object value, Type toType, Func<object> getConverter)
1243         {
1244             if (value == null)
1245                 return null;
1246
1247             var str = value as string;
1248             if (str != null)
1249             {
1250                 //If there's a [TypeConverter], use it
1251                 object converter = getConverter?.Invoke();
1252                 var xfTypeConverter = converter as Tizen.NUI.Binding.TypeConverter;
1253                 if (xfTypeConverter != null)
1254                     return value = xfTypeConverter.ConvertFromInvariantString(str);
1255                 var converterType = converter?.GetType();
1256                 if (converterType != null)
1257                 {
1258                     var convertFromStringInvariant = converterType.GetRuntimeMethod("ConvertFromInvariantString",
1259                         new[] { typeof(string) });
1260                     if (convertFromStringInvariant != null)
1261                         return value = convertFromStringInvariant.Invoke(converter, new object[] { str });
1262                 }
1263
1264                 //If the type is nullable, as the value is not null, it's safe to assume we want the built-in conversion
1265                 if (toType.GetTypeInfo().IsGenericType && toType.GetGenericTypeDefinition() == typeof(Nullable<>))
1266                     toType = Nullable.GetUnderlyingType(toType);
1267
1268                 //Obvious Built-in conversions
1269                 if (toType.GetTypeInfo().IsEnum)
1270                     return Enum.Parse(toType, str, true);
1271                 if (toType == typeof(SByte))
1272                     return SByte.Parse(str, CultureInfo.InvariantCulture);
1273                 if (toType == typeof(Int16))
1274                     return Int16.Parse(str, CultureInfo.InvariantCulture);
1275                 if (toType == typeof(Int32))
1276                     return Int32.Parse(str, CultureInfo.InvariantCulture);
1277                 if (toType == typeof(Int64))
1278                     return Int64.Parse(str, CultureInfo.InvariantCulture);
1279                 if (toType == typeof(Byte))
1280                     return Byte.Parse(str, CultureInfo.InvariantCulture);
1281                 if (toType == typeof(UInt16))
1282                     return UInt16.Parse(str, CultureInfo.InvariantCulture);
1283                 if (toType == typeof(UInt32))
1284                     return UInt32.Parse(str, CultureInfo.InvariantCulture);
1285                 if (toType == typeof(UInt64))
1286                     return UInt64.Parse(str, CultureInfo.InvariantCulture);
1287                 if (toType == typeof(Single))
1288                     return Single.Parse(str, CultureInfo.InvariantCulture);
1289                 if (toType == typeof(Double))
1290                     return Double.Parse(str, CultureInfo.InvariantCulture);
1291                 if (toType == typeof(Boolean))
1292                     return Boolean.Parse(str);
1293                 if (toType == typeof(TimeSpan))
1294                     return TimeSpan.Parse(str, CultureInfo.InvariantCulture);
1295                 if (toType == typeof(DateTime))
1296                     return DateTime.Parse(str, CultureInfo.InvariantCulture);
1297                 if (toType == typeof(Char))
1298                 {
1299                     char c = '\0';
1300                     _ = Char.TryParse(str, out c);
1301                     return c;
1302                 }
1303                 if (toType == typeof(String) && str.StartsWith("{}", StringComparison.Ordinal))
1304                     return str.Substring(2);
1305                 if (toType == typeof(String))
1306                     return value;
1307                 if (toType == typeof(Decimal))
1308                     return Decimal.Parse(str, CultureInfo.InvariantCulture);
1309             }
1310
1311             //if the value is not assignable and there's an implicit conversion, convert
1312             if (value != null && !toType.IsAssignableFrom(value.GetType()))
1313             {
1314                 var opImplicit = GetImplicitConversionOperator(value.GetType(), value.GetType(), toType)
1315                                  ?? GetImplicitConversionOperator(toType, value.GetType(), toType);
1316                 //var opImplicit = value.GetType().GetImplicitConversionOperator(fromType: value.GetType(), toType: toType)
1317                 //                ?? toType.GetImplicitConversionOperator(fromType: value.GetType(), toType: toType);
1318
1319                 if (opImplicit != null)
1320                 {
1321                     value = opImplicit.Invoke(null, new[] { value });
1322                     return value;
1323                 }
1324             }
1325
1326             return value;
1327         }
1328
1329         internal string GetTypeConverterTypeName(IEnumerable<CustomAttributeData> attributes)
1330         {
1331             var converterAttribute =
1332                 attributes.FirstOrDefault(cad => Tizen.NUI.Binding.TypeConverterAttribute.TypeConvertersType.Contains(cad.AttributeType.FullName));
1333             if (converterAttribute == null)
1334                 return null;
1335             if (converterAttribute.ConstructorArguments[0].ArgumentType == typeof(string))
1336                 return (string)converterAttribute.ConstructorArguments[0].Value;
1337             if (converterAttribute.ConstructorArguments[0].ArgumentType == typeof(Type))
1338                 return ((Type)converterAttribute.ConstructorArguments[0].Value).AssemblyQualifiedName;
1339             return null;
1340         }
1341
1342         internal MethodInfo GetImplicitConversionOperator(Type onType, Type fromType, Type toType)
1343         {
1344 #if NETSTANDARD1_0
1345             var mi = onType.GetRuntimeMethod("op_Implicit", new[] { fromType });
1346 #else
1347             var bindingFlags = BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy;
1348             var mi = onType.GetMethod("op_Implicit", bindingFlags, null, new[] { fromType }, null);
1349 #endif
1350             if (mi == null) return null;
1351             if (!mi.IsSpecialName) return null;
1352             if (!mi.IsPublic) return null;
1353             if (!mi.IsStatic) return null;
1354             if (!toType.IsAssignableFrom(mi.ReturnType)) return null;
1355
1356             return mi;
1357         }
1358
1359         internal Animation(float durationSeconds) : this(Interop.Animation.New(durationSeconds), true)
1360         {
1361             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1362
1363         }
1364
1365         internal Animation(Animation handle) : this(Interop.Animation.NewAnimation(Animation.getCPtr(handle)), true)
1366         {
1367             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1368         }
1369
1370         internal Animation Assign(Animation rhs)
1371         {
1372             Animation ret = new Animation(Interop.Animation.Assign(SwigCPtr, Animation.getCPtr(rhs)), false);
1373             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1374             return ret;
1375         }
1376
1377         internal void SetDuration(float seconds)
1378         {
1379             Interop.Animation.SetDuration(SwigCPtr, seconds);
1380             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1381         }
1382
1383         internal float GetDuration()
1384         {
1385             float ret = Interop.Animation.GetDuration(SwigCPtr);
1386             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1387             return ret;
1388         }
1389
1390         internal void SetLooping(bool looping)
1391         {
1392             Interop.Animation.SetLooping(SwigCPtr, looping);
1393             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1394         }
1395
1396         internal void SetLoopCount(int count)
1397         {
1398             Interop.Animation.SetLoopCount(SwigCPtr, count);
1399             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1400         }
1401
1402         internal int GetLoopCount()
1403         {
1404             int ret = Interop.Animation.GetLoopCount(SwigCPtr);
1405             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1406             return ret;
1407         }
1408
1409         internal int GetCurrentLoop()
1410         {
1411             int ret = Interop.Animation.GetCurrentLoop(SwigCPtr);
1412             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1413             return ret;
1414         }
1415
1416         internal bool IsLooping()
1417         {
1418             bool ret = Interop.Animation.IsLooping(SwigCPtr);
1419             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1420             return ret;
1421         }
1422
1423         internal void SetEndAction(Animation.EndActions action)
1424         {
1425             Interop.Animation.SetEndAction(SwigCPtr, (int)action);
1426             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1427         }
1428
1429         internal Animation.EndActions GetEndAction()
1430         {
1431             Animation.EndActions ret = (Animation.EndActions)Interop.Animation.GetEndAction(SwigCPtr);
1432             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1433             return ret;
1434         }
1435
1436         internal void SetDisconnectAction(Animation.EndActions disconnectAction)
1437         {
1438             Interop.Animation.SetDisconnectAction(SwigCPtr, (int)disconnectAction);
1439             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1440         }
1441
1442         internal Animation.EndActions GetDisconnectAction()
1443         {
1444             Animation.EndActions ret = (Animation.EndActions)Interop.Animation.GetDisconnectAction(SwigCPtr);
1445             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1446             return ret;
1447         }
1448
1449         internal void SetDefaultAlphaFunction(AlphaFunction alpha)
1450         {
1451             Interop.Animation.SetDefaultAlphaFunction(SwigCPtr, AlphaFunction.getCPtr(alpha));
1452             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1453         }
1454
1455         internal AlphaFunction GetDefaultAlphaFunction()
1456         {
1457             AlphaFunction ret = new AlphaFunction(Interop.Animation.GetDefaultAlphaFunction(SwigCPtr), true);
1458             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1459             return ret;
1460         }
1461
1462         internal void SetCurrentProgress(float progress)
1463         {
1464             Interop.Animation.SetCurrentProgress(SwigCPtr, progress);
1465             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1466         }
1467
1468         internal float GetCurrentProgress()
1469         {
1470             float ret = Interop.Animation.GetCurrentProgress(SwigCPtr);
1471             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1472             return ret;
1473         }
1474
1475         internal void SetSpeedFactor(float factor)
1476         {
1477             Interop.Animation.SetSpeedFactor(SwigCPtr, factor);
1478             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1479         }
1480
1481         internal float GetSpeedFactor()
1482         {
1483             float ret = Interop.Animation.GetSpeedFactor(SwigCPtr);
1484             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1485             return ret;
1486         }
1487
1488         internal void SetPlayRange(Vector2 range)
1489         {
1490             Interop.Animation.SetPlayRange(SwigCPtr, Vector2.getCPtr(range));
1491             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1492         }
1493
1494         internal Vector2 GetPlayRange()
1495         {
1496             Vector2 ret = new Vector2(Interop.Animation.GetPlayRange(SwigCPtr), true);
1497             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1498             return ret;
1499         }
1500
1501         internal Animation.States GetState()
1502         {
1503             Animation.States ret = (Animation.States)Interop.Animation.GetState(SwigCPtr);
1504             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1505             return ret;
1506         }
1507
1508         internal AnimationSignal FinishedSignal()
1509         {
1510             AnimationSignal ret = new AnimationSignal(Interop.Animation.FinishedSignal(SwigCPtr), false);
1511             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1512             return ret;
1513         }
1514
1515         internal AnimationSignal ProgressReachedSignal()
1516         {
1517             AnimationSignal ret = new AnimationSignal(Interop.Animation.ProgressReachedSignal(SwigCPtr), false);
1518             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1519             return ret;
1520         }
1521
1522         internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha)
1523         {
1524             if (alpha == null)
1525             {
1526                 Interop.Animation.AnimateBy(SwigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue));
1527             }
1528             else
1529             {
1530                 Interop.Animation.AnimateByAlphaFunction(SwigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha));
1531             }
1532             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1533         }
1534
1535         internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha, TimePeriod period)
1536         {
1537             if (alpha == null)
1538             {
1539                 Interop.Animation.AnimateByTimePeriod(SwigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), TimePeriod.getCPtr(period));
1540             }
1541             else
1542             {
1543                 Interop.Animation.AnimateBy(SwigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1544             }
1545             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1546         }
1547
1548         internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha)
1549         {
1550             if (alpha == null)
1551             {
1552                 Interop.Animation.AnimateTo(SwigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue));
1553             }
1554             else
1555             {
1556                 Interop.Animation.AnimateToAlphaFunction(SwigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha));
1557             }
1558             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1559         }
1560
1561         internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha, TimePeriod period)
1562         {
1563             if (alpha == null)
1564             {
1565                 Interop.Animation.AnimateToTimePeriod(SwigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), TimePeriod.getCPtr(period));
1566             }
1567             else
1568             {
1569                 Interop.Animation.AnimateTo(SwigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1570             }
1571             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1572         }
1573
1574
1575         internal void AnimateByIntPtr(Property target, global::System.IntPtr relativeValueIntPtr, AlphaFunction alpha)
1576         {
1577             if (alpha == null)
1578             {
1579                 Interop.Animation.AnimateBy(SwigCPtr, Property.getCPtr(target), relativeValueIntPtr);
1580             }
1581             else
1582             {
1583                 Interop.Animation.AnimateByAlphaFunction(SwigCPtr, Property.getCPtr(target), relativeValueIntPtr, AlphaFunction.getCPtr(alpha));
1584             }
1585             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1586         }
1587
1588         internal void AnimateByIntPtr(Property target, global::System.IntPtr relativeValueIntPtr, AlphaFunction alpha, TimePeriod period)
1589         {
1590             if (alpha == null)
1591             {
1592                 Interop.Animation.AnimateByTimePeriod(SwigCPtr, Property.getCPtr(target), relativeValueIntPtr, TimePeriod.getCPtr(period));
1593             }
1594             else
1595             {
1596                 Interop.Animation.AnimateBy(SwigCPtr, Property.getCPtr(target), relativeValueIntPtr, AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1597             }
1598             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1599         }
1600
1601         internal void AnimateToIntPtr(Property target, global::System.IntPtr destinationValueIntPtr, AlphaFunction alpha)
1602         {
1603             if (alpha == null)
1604             {
1605                 Interop.Animation.AnimateTo(SwigCPtr, Property.getCPtr(target), destinationValueIntPtr);
1606             }
1607             else
1608             {
1609                 Interop.Animation.AnimateToAlphaFunction(SwigCPtr, Property.getCPtr(target), destinationValueIntPtr, AlphaFunction.getCPtr(alpha));
1610             }
1611             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1612         }
1613
1614         internal void AnimateToIntPtr(Property target, global::System.IntPtr destinationValueIntPtr, AlphaFunction alpha, TimePeriod period)
1615         {
1616             if (alpha == null)
1617             {
1618                 Interop.Animation.AnimateToTimePeriod(SwigCPtr, Property.getCPtr(target), destinationValueIntPtr, TimePeriod.getCPtr(period));
1619             }
1620             else
1621             {
1622                 Interop.Animation.AnimateTo(SwigCPtr, Property.getCPtr(target), destinationValueIntPtr, AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1623             }
1624             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1625         }
1626
1627         internal void AnimateBetween(Property target, KeyFrames keyFrames)
1628         {
1629             Interop.Animation.AnimateBetween(SwigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames));
1630             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1631         }
1632
1633         internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha)
1634         {
1635             Interop.Animation.AnimateBetweenAlphaFunction(SwigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha));
1636             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1637         }
1638
1639         internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, Animation.Interpolation interpolation)
1640         {
1641             if (alpha == null)
1642             {
1643                 Interop.Animation.AnimateBetween(SwigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), (int)interpolation);
1644             }
1645             else
1646             {
1647                 Interop.Animation.AnimateBetweenAlphaFunctionInterpolation(SwigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), (int)interpolation);
1648             }
1649             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1650         }
1651
1652         internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period)
1653         {
1654             Interop.Animation.AnimateBetweenTimePeriod(SwigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period));
1655             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1656         }
1657
1658         internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period)
1659         {
1660             Interop.Animation.AnimateBetween(SwigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1661             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1662         }
1663
1664         internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Animation.Interpolation interpolation)
1665         {
1666             if (alpha == null)
1667             {
1668                 Interop.Animation.AnimateBetweenTimePeriodInterpolation(SwigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period), (int)interpolation);
1669             }
1670             else
1671             {
1672                 Interop.Animation.AnimateBetween(SwigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period), (int)interpolation);
1673             }
1674             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1675         }
1676
1677         internal void Animate(View view, Path path, Vector3 forward)
1678         {
1679             Interop.Animation.Animate(SwigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward));
1680             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1681         }
1682
1683         internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha)
1684         {
1685             Interop.Animation.AnimateAlphaFunction(SwigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha));
1686             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1687         }
1688
1689         internal void Animate(View view, Path path, Vector3 forward, TimePeriod period)
1690         {
1691             Interop.Animation.AnimateTimePeriod(SwigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), TimePeriod.getCPtr(period));
1692             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1693         }
1694
1695         internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha, TimePeriod period)
1696         {
1697             Interop.Animation.Animate(SwigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1698             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1699         }
1700
1701         internal void Show(View view, float delaySeconds)
1702         {
1703             Interop.Animation.Show(SwigCPtr, View.getCPtr(view), delaySeconds);
1704             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1705         }
1706
1707         internal void Hide(View view, float delaySeconds)
1708         {
1709             Interop.Animation.Hide(SwigCPtr, View.getCPtr(view), delaySeconds);
1710             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1711         }
1712
1713         /// <summary>
1714         /// To make animation instance be disposed.
1715         /// </summary>
1716         /// <since_tizen> 3 </since_tizen>
1717         protected override void Dispose(DisposeTypes type)
1718         {
1719             if (disposed)
1720             {
1721                 return;
1722             }
1723
1724             if (animationFinishedEventHandler != null)
1725             {
1726                 AnimationSignal finishedSignal = FinishedSignal();
1727                 finishedSignal?.Disconnect(finishedCallbackOfNative);
1728                 finishedSignal?.Dispose();
1729                 animationFinishedEventHandler = null;
1730             }
1731
1732             if (animationProgressReachedEventCallback != null)
1733             {
1734                 AnimationSignal progressReachedSignal = ProgressReachedSignal();
1735                 progressReachedSignal?.Disconnect(animationProgressReachedEventCallback);
1736                 progressReachedSignal?.Dispose();
1737                 animationProgressReachedEventCallback = null;
1738             }
1739
1740             base.Dispose(type);
1741         }
1742
1743         /// This will not be public opened.
1744         [EditorBrowsable(EditorBrowsableState.Never)]
1745         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
1746         {
1747             if (swigCPtr.Handle == IntPtr.Zero || Disposed)
1748             {
1749                 Tizen.Log.Fatal("NUI", $"[ERROR] Animation ReleaseSwigCPtr()! IntPtr=0x{swigCPtr.Handle:X} Disposed={Disposed}");
1750                 return;
1751             }
1752             Interop.Animation.DeleteAnimation(swigCPtr);
1753         }
1754
1755         private void OnFinished(IntPtr data)
1756         {
1757             if (animationFinishedEventHandler != null)
1758             {
1759                 //here we send all data to user event handlers
1760                 animationFinishedEventHandler(this, null);
1761             }
1762         }
1763
1764         private void OnProgressReached(IntPtr data)
1765         {
1766             if (animationProgressReachedEventHandler != null)
1767             {
1768                 //here we send all data to user event handlers
1769                 animationProgressReachedEventHandler(this, null);
1770             }
1771         }
1772
1773         private float MilliSecondsToSeconds(int millisec)
1774         {
1775             return (float)millisec / 1000.0f;
1776         }
1777
1778         private int SecondsToMilliSeconds(float sec)
1779         {
1780             return (int)(sec * 1000);
1781         }
1782     }
1783 }