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