59fa58a05a19f6887b9437b3947f98c8428506ea
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Animation.cs
1 /*
2  * Copyright(c) 2019 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 Tizen.NUI.BaseComponents;
24
25     using System.Collections;
26     using System.Collections.Generic;
27     using System.Linq;
28     using System.Reflection;
29     using System.Xml;
30     using Tizen.NUI.Binding.Internals;
31     using Tizen.NUI.Binding;
32     using System.Globalization;
33     using Tizen.NUI.Xaml.Internals;
34
35     /// <summary>
36     /// Animation can be used to animate the properties of any number of objects, typically view.<br />
37     /// If the "Finished" event is connected to a member function of an object, it must be disconnected before the object is destroyed.<br />
38     /// This is typically done in the object destructor, and requires either the animation handle to be stored.<br />
39     /// 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 />
40     /// If any of the individual calls to those functions exceeds the overall animation time (Duration), then the overall animation time is automatically extended.<br />
41     /// </summary>
42     /// <since_tizen> 3 </since_tizen>
43     public class Animation : BaseHandle
44     {
45         private static bool? disableAnimation = null;
46
47
48         private AnimationFinishedEventCallbackType _animationFinishedEventCallback;
49         private System.IntPtr _finishedCallbackOfNative;
50
51         private AnimationProgressReachedEventCallbackType _animationProgressReachedEventCallback;
52
53         private string[] _properties = null;
54         private string[] _destValue = null;
55         private int[] _startTime = null;
56         private int[] _endTime = 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.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(Interop.Animation.Animation_SWIGUpcast(cPtr), cMemoryOwn)
73         {
74
75             _animationFinishedEventCallback = OnFinished;
76             _finishedCallbackOfNative = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(_animationFinishedEventCallback);
77         }
78
79         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
80         private delegate void AnimationFinishedEventCallbackType(IntPtr data);
81
82         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
83         private delegate void AnimationProgressReachedEventCallbackType(IntPtr data);
84
85         private event EventHandler _animationFinishedEventHandler;
86
87         /**
88         * @brief Event for the finished signal which can be used to subscribe or unsubscribe the event handler.
89         * The finished signal is emitted when an animation's animations have finished.
90         */
91         /// <since_tizen> 3 </since_tizen>
92         public event EventHandler Finished
93         {
94             add
95             {
96                 if (_animationFinishedEventHandler == null && disposed == false)
97                 {
98                     FinishedSignal().Connect(_finishedCallbackOfNative);
99                 }
100                 _animationFinishedEventHandler += value;
101             }
102             remove
103             {
104                 _animationFinishedEventHandler -= value;
105
106                 if (_animationFinishedEventHandler == null && FinishedSignal().Empty() == false)
107                 {
108                     FinishedSignal().Disconnect(_finishedCallbackOfNative);
109                 }
110             }
111         }
112
113         private event EventHandler _animationProgressReachedEventHandler;
114
115         /**
116        * @brief Event for the ProgressReached signal, which can be used to subscribe or unsubscribe the event handler.
117        * The ProgressReached signal is emitted when the animation has reached a given progress percentage, this is set in the api SetProgressNotification.
118        */
119         /// <since_tizen> 3 </since_tizen>
120         public event EventHandler ProgressReached
121         {
122             add
123             {
124                 if (_animationProgressReachedEventHandler == null)
125                 {
126                     _animationProgressReachedEventCallback = OnProgressReached;
127                     ProgressReachedSignal().Connect(_animationProgressReachedEventCallback);
128                 }
129
130                 _animationProgressReachedEventHandler += value;
131             }
132             remove
133             {
134                 _animationProgressReachedEventHandler -= value;
135
136                 if (_animationProgressReachedEventHandler == null && ProgressReachedSignal().Empty() == false)
137                 {
138                     ProgressReachedSignal().Disconnect(_animationProgressReachedEventCallback);
139                 }
140             }
141         }
142
143         /// <summary>
144         /// Enumeration for what to do when the animation ends, stopped, or destroyed.
145         /// </summary>
146         /// <since_tizen> 3 </since_tizen>
147         public enum EndActions
148         {
149             /// <summary>
150             /// When the animation ends, the animated property values are saved.
151             /// </summary>
152             Cancel,
153             /// <summary>
154             /// When the animation ends, the animated property values are forgotten.
155             /// </summary>
156             Discard,
157             /// <summary>
158             /// If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like cancel.
159             /// </summary>
160             StopFinal
161         }
162
163         /// <summary>
164         /// Enumeration for what interpolation method to use on key-frame animations.
165         /// </summary>
166         /// <since_tizen> 3 </since_tizen>
167         public enum Interpolation
168         {
169             /// <summary>
170             /// Values in between key frames are interpolated using a linear polynomial. (Default)
171             /// </summary>
172             Linear,
173             /// <summary>
174             /// Values in between key frames are interpolated using a cubic polynomial.
175             /// </summary>
176             Cubic
177         }
178
179         /// <summary>
180         /// Enumeration for what state the animation is in.
181         /// </summary>
182         /// <remarks>Calling Reset() on this class will not reset the animation. It will call the BaseHandle.Reset() which drops the object handle.</remarks>
183         /// <since_tizen> 3 </since_tizen>
184         public enum States
185         {
186             /// <summary>
187             /// The animation has stopped.
188             /// </summary>
189             Stopped,
190             /// <summary>
191             /// The animation is playing.
192             /// </summary>
193             Playing,
194             /// <summary>
195             /// The animation is paused.
196             /// </summary>
197             Paused
198         }
199
200         /// <summary>
201         /// Gets or sets the duration in milliseconds of the animation.
202         /// </summary>
203         /// <since_tizen> 3 </since_tizen>
204         public int Duration
205         {
206             set
207             {
208                 SetDuration(MilliSecondsToSeconds(value));
209             }
210             get
211             {
212                 return SecondsToMilliSeconds(GetDuration());
213             }
214         }
215
216         /// <summary>
217         ///  Gets or sets the default alpha function for the animation.
218         /// </summary>
219         /// <since_tizen> 3 </since_tizen>
220         public AlphaFunction DefaultAlphaFunction
221         {
222             set
223             {
224                 SetDefaultAlphaFunction(value);
225             }
226             get
227             {
228                 AlphaFunction ret = GetDefaultAlphaFunction();
229                 return ret;
230             }
231         }
232
233         /// <summary>
234         /// Queries the state of the animation.
235         /// </summary>
236         /// <since_tizen> 3 </since_tizen>
237         public States State
238         {
239             get
240             {
241                 return GetState();
242             }
243         }
244
245         /// <summary>
246         /// Set: Enables looping for a specified number of repeats. A zero is the same as Looping = true; i.e., repeat forever.<br />
247         /// This property resets the looping value and should not be used with the Looping property.<br />
248         /// Setting this parameter does not cause the animation to Play().<br />
249         /// Get: Gets the loop count. A zero is the same as Looping = true; i.e., repeat forever.<br />
250         /// The loop count is initially 1 for play once.<br />
251         /// </summary>
252         /// <since_tizen> 3 </since_tizen>
253         public int LoopCount
254         {
255             set
256             {
257                 SetLoopCount(value);
258             }
259             get
260             {
261                 int ret = GetLoopCount();
262                 return ret;
263             }
264         }
265
266         /// <summary>
267         /// Gets or sets the status of whether the animation will loop.<br />
268         /// This property resets the loop count and should not be used with the LoopCount property.<br />
269         /// Setting this parameter does not cause the animation to Play().<br />
270         /// </summary>
271         /// <since_tizen> 3 </since_tizen>
272         public bool Looping
273         {
274             set
275             {
276                 SetLooping(value);
277             }
278             get
279             {
280                 bool ret = IsLooping();
281                 return ret;
282             }
283         }
284
285
286         /// <summary>
287         /// Gets or sets the end action of the animation.<br />
288         /// This action is performed when the animation ends or if it is stopped.<br />
289         /// The default end action is cancel.<br />
290         /// </summary>
291         /// <since_tizen> 3 </since_tizen>
292         public EndActions EndAction
293         {
294             set
295             {
296                 SetEndAction(value);
297             }
298             get
299             {
300                 return GetEndAction();
301             }
302         }
303
304         /// <summary>
305         /// Gets the current loop count.<br />
306         /// A value 0 indicating the current loop count when looping.<br />
307         /// </summary>
308         /// <since_tizen> 3 </since_tizen>
309         public int CurrentLoop
310         {
311             get
312             {
313                 return GetCurrentLoop();
314             }
315         }
316
317         /// <summary>
318         /// Gets or sets the disconnect action.<br />
319         /// If any of the animated property owners are disconnected from the stage while the animation is being played, then this action is performed.<br />
320         /// The default action is cancel.<br />
321         /// </summary>
322         /// <since_tizen> 3 </since_tizen>
323         public EndActions DisconnectAction
324         {
325             set
326             {
327                 Interop.Animation.Animation_SetDisconnectAction(swigCPtr, (int)value);
328                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
329             }
330             get
331             {
332                 Animation.EndActions ret = (Animation.EndActions)Interop.Animation.Animation_GetDisconnectAction(swigCPtr);
333                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
334                 return ret;
335             }
336         }
337
338
339         /// <summary>
340         /// Gets or sets the progress of the animation.<br />
341         /// The animation will play (or continue playing) from this point.<br />
342         /// The progress must be in the 0-1 interval or in the play range interval if defined<br />
343         /// otherwise, it will be ignored.<br />
344         /// </summary>
345         /// <since_tizen> 3 </since_tizen>
346         public float CurrentProgress
347         {
348             set
349             {
350                 Interop.Animation.Animation_SetCurrentProgress(swigCPtr, value);
351                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
352             }
353             get
354             {
355                 float ret = Interop.Animation.Animation_GetCurrentProgress(swigCPtr);
356                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
357                 return ret;
358             }
359         }
360
361         /// <summary>
362         /// Gets or sets specificifications of a speed factor for the animation.<br />
363         /// The speed factor is a multiplier of the normal velocity of the animation.<br />
364         /// Values between [0, 1] will slow down the animation and values above one will speed up the animation.<br />
365         /// It is also possible to specify a negative multiplier to play the animation in reverse.<br />
366         /// </summary>
367         /// <since_tizen> 3 </since_tizen>
368         public float SpeedFactor
369         {
370             set
371             {
372                 Interop.Animation.Animation_SetSpeedFactor(swigCPtr, value);
373                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
374             }
375             get
376             {
377                 float ret = Interop.Animation.Animation_GetSpeedFactor(swigCPtr);
378                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
379                 return ret;
380             }
381         }
382
383         /// <summary>
384         /// Gets or sets the playing range.<br />
385         /// Animation will play between the values specified. Both values (range.x and range.y ) should be between 0-1,
386         /// otherwise they will be ignored. If the range provided is not in proper order (minimum, maximum ), it will be reordered.<br />
387         /// </summary>
388         /// <since_tizen> 3 </since_tizen>
389         public RelativeVector2 PlayRange
390         {
391             set
392             {
393                 Interop.Animation.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(value));
394                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
395             }
396             get
397             {
398                 Vector2 ret = new Vector2(Interop.Animation.Animation_GetPlayRange(swigCPtr), true);
399                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
400                 return ret;
401             }
402         }
403
404
405         /// <summary>
406         /// Gets or sets the progress notification marker which triggers the ProgressReachedSignal.<br />
407         /// Percentage of animation progress should be greater than 0 and less than 1, for example, 0.3 for 30% <br />
408         /// One notification can be set on each animation.
409         /// </summary>
410         /// <since_tizen> 3 </since_tizen>
411         public float ProgressNotification
412         {
413             set
414             {
415                 Interop.Animation.Animation_SetProgressNotification(swigCPtr, value);
416                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
417             }
418             get
419             {
420                 float ret = Interop.Animation.Animation_GetProgressNotification(swigCPtr);
421                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
422                 return ret;
423             }
424         }
425
426         /// <summary>
427         /// Gets or sets the properties of the animation.
428         /// </summary>
429         public string[] Properties
430         {
431             get
432             {
433                 return _properties;
434             }
435             set
436             {
437                 _properties = value;
438             }
439         }
440
441         /// <summary>
442         /// Gets or sets the destination value for each property of the animation.
443         /// </summary>
444         public string[] DestValue
445         {
446             get
447             {
448                 return _destValue;
449             }
450             set
451             {
452                 _destValue = value;
453             }
454         }
455
456         /// <summary>
457         /// Gets or sets the start time for each property of the animation.
458         /// </summary>
459         public int[] StartTime
460         {
461             get
462             {
463                 return _startTime;
464             }
465             set
466             {
467                 _startTime = value;
468             }
469         }
470
471         /// <summary>
472         /// Gets or sets the end time for each property of the animation.
473         /// </summary>
474         public int[] EndTime
475         {
476             get
477             {
478                 return _endTime;
479             }
480             set
481             {
482                 _endTime = value;
483             }
484         }
485
486         private bool DisableAnimation
487         {
488             get
489             {
490                 if (disableAnimation.HasValue == false)
491                 {
492                     string type = Environment.GetEnvironmentVariable("PlatformSmartType");
493                     if (type == "Entry")
494                         disableAnimation = true;
495                     else
496                         disableAnimation = false;
497                 }
498                 return disableAnimation.Value;
499             }
500         }
501
502         /// <summary>
503         /// Downcasts a handle to animation handle.<br />
504         /// If handle points to an animation object, the downcast produces a valid handle.<br />
505         /// If not, the returned handle is left uninitialized.<br />
506         /// </summary>
507         /// <param name="handle">Handle to an object.</param>
508         /// <returns>Handle to an animation object or an uninitialized handle.</returns>
509         /// <since_tizen> 3 </since_tizen>
510         [Obsolete("Deprecated in API6, Will be removed in API9, Please use as keyword instead!")]
511         [EditorBrowsable(EditorBrowsableState.Never)]
512         public static Animation DownCast(BaseHandle handle)
513         {
514             Animation ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Animation;
515             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
516             return ret;
517         }
518
519         /// <summary>
520         /// Stops the animation.
521         /// </summary>
522         /// <param name="action">The end action can be set.</param>
523         /// <since_tizen> 3 </since_tizen>
524         public void Stop(EndActions action = EndActions.Cancel)
525         {
526             SetEndAction(action);
527             Interop.Animation.Animation_Stop(swigCPtr);
528             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
529         }
530
531         /// <summary>
532         /// Animates a property value by a relative amount.<br />
533         /// </summary>
534         /// <param name="target">The target object to animate.</param>
535         /// <param name="property">The target property to animate.</param>
536         /// <param name="relativeValue">The property value will change by this amount.</param>
537         /// <param name="alphaFunction">The alpha function to apply.</param>
538         /// <since_tizen> 3 </since_tizen>
539         public void AnimateBy(View target, string property, object relativeValue, AlphaFunction alphaFunction = null)
540         {
541             Property _prop = PropertyHelper.GetPropertyFromString(target, property);
542             relativeValue = AvoidFloatPropertyHasIntegerValue(target, _prop, relativeValue);
543             PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
544
545             if (alphaFunction != null)
546             {
547                 AnimateBy(_prop, val, alphaFunction);
548             }
549             else
550             {
551                 AnimateBy(_prop, val);
552             }
553         }
554
555         /// <summary>
556         /// Animates a property value by a relative amount.<br />
557         /// </summary>
558         /// <param name="target">The target object to animate.</param>
559         /// <param name="property">The target property to animate.</param>
560         /// <param name="relativeValue">The property value will change by this amount.</param>
561         /// <param name="startTime">The start time of the animation.</param>
562         /// <param name="endTime">The end time of the animation.</param>
563         /// <param name="alphaFunction">The alpha function to apply.</param>
564         /// <since_tizen> 3 </since_tizen>
565         public void AnimateBy(View target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
566         {
567             Property _prop = PropertyHelper.GetPropertyFromString(target, property);
568             relativeValue = AvoidFloatPropertyHasIntegerValue(target, _prop, relativeValue);
569             PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
570
571             if (alphaFunction != null)
572             {
573                 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
574                 AnimateBy(_prop, val, alphaFunction, time);
575             }
576             else
577             {
578                 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
579                 AnimateBy(_prop, val, time);
580             }
581         }
582
583         /// <summary>
584         /// Animates a property to a destination value.<br />
585         /// </summary>
586         /// <param name="target">The target object to animate.</param>
587         /// <param name="property">The target property to animate.</param>
588         /// <param name="destinationValue">The destination value.</param>
589         /// <param name="alphaFunction">The alpha function to apply.</param>
590         /// <since_tizen> 3 </since_tizen>
591         public void AnimateTo(View target, string property, object destinationValue, AlphaFunction alphaFunction = null)
592         {
593             Property _prop = PropertyHelper.GetPropertyFromString(target, property);
594             destinationValue = AvoidFloatPropertyHasIntegerValue(target, _prop, destinationValue);
595             PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
596
597             if (alphaFunction != null)
598             {
599                 AnimateTo(_prop, val, alphaFunction);
600             }
601             else
602             {
603                 AnimateTo(_prop, val);
604             }
605         }
606
607         /// <summary>
608         /// Animates one or more properties to a destination value.<br />
609         /// </summary>
610         /// <param name="target">The target object to animate.</param>
611         public void PlayAnimateTo(View target)
612         {
613             Clear();
614             if (_properties.Length == _destValue.Length && _startTime.Length == _endTime.Length && _properties.Length == _startTime.Length)
615             {
616                 int length = _properties.Length;
617                 for (int index = 0; index < length; index++)
618                 {
619                     //object destinationValue = _destValue[index];
620                     var elementType = target.GetType();
621                     PropertyInfo propertyInfo = elementType.GetProperties().FirstOrDefault(fi => fi.Name == _properties[index]);
622                     //var propertyInfo = elementType.GetRuntimeProperties().FirstOrDefault(p => p.Name == localName);
623                     if (propertyInfo != null)
624                     {
625                         object destinationValue = ConvertTo(_destValue[index], propertyInfo.PropertyType);
626
627                         if (destinationValue != null)
628                         {
629                             AnimateTo(target, _properties[index], destinationValue, _startTime[index], _endTime[index]);
630                         }
631                     }
632                 }
633                 Play();
634             }
635         }
636
637         /// <summary>
638         /// Animates a property to a destination value.<br />
639         /// </summary>
640         /// <param name="target">The target object to animate.</param>
641         /// <param name="property">The target property to animate.</param>
642         /// <param name="destinationValue">The destination value.</param>
643         /// <param name="startTime">The start time of the animation.</param>
644         /// <param name="endTime">The end time of the animation.</param>
645         /// <param name="alphaFunction">The alpha function to apply.</param>
646         /// <since_tizen> 3 </since_tizen>
647         public void AnimateTo(View target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
648         {
649             Property _prop = PropertyHelper.GetPropertyFromString(target, property);
650             destinationValue = AvoidFloatPropertyHasIntegerValue(target, _prop, destinationValue);
651             PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
652
653             if (alphaFunction != null)
654             {
655                 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
656                 AnimateTo(_prop, val, alphaFunction, time);
657             }
658             else
659             {
660                 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
661                 AnimateTo(_prop, val, time);
662             }
663         }
664
665         /// <summary>
666         /// Animates a property between keyframes.
667         /// </summary>
668         /// <param name="target">The target object to animate.</param>
669         /// <param name="property">The target property to animate.</param>
670         /// <param name="keyFrames">The set of time or value pairs between which to animate.</param>
671         /// <param name="interpolation">The method used to interpolate between values.</param>
672         /// <param name="alphaFunction">The alpha function to apply.</param>
673         /// <since_tizen> 3 </since_tizen>
674         public void AnimateBetween(View target, string property, KeyFrames keyFrames, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
675         {
676             Property _prop = PropertyHelper.GetPropertyFromString(target, property);
677
678             if (_prop.propertyIndex == Property.INVALID_INDEX)
679             {
680                 throw new System.ArgumentException("second argument string property is invalid parameter!");
681             }
682
683             if (alphaFunction != null)
684             {
685                 AnimateBetween(_prop, keyFrames, alphaFunction, interpolation);
686             }
687             else
688             {
689                 AnimateBetween(_prop, keyFrames, interpolation);
690             }
691         }
692
693         /// <summary>
694         /// Animates a property between keyframes.
695         /// </summary>
696         /// <param name="target">The target object to animate</param>
697         /// <param name="property">The target property to animate</param>
698         /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
699         /// <param name="startTime">The start time of animation in milliseconds.</param>
700         /// <param name="endTime">The end time of animation in milliseconds.</param>
701         /// <param name="interpolation">The method used to interpolate between values.</param>
702         /// <param name="alphaFunction">The alpha function to apply.</param>
703         /// <since_tizen> 3 </since_tizen>
704         public void AnimateBetween(View target, string property, KeyFrames keyFrames, int startTime, int endTime, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
705         {
706             Property _prop = PropertyHelper.GetPropertyFromString(target, property);
707
708             Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
709             if (alphaFunction != null)
710             {
711                 AnimateBetween(_prop, keyFrames, alphaFunction, time, interpolation);
712             }
713             else
714             {
715                 AnimateBetween(_prop, keyFrames, time, interpolation);
716             }
717         }
718
719         /// <summary>
720         /// Animates the view's position and orientation through a predefined path.<br />
721         /// The view will rotate to orient the supplied forward vector with the path's tangent.<br />
722         /// If forward is the zero vector then no rotation will happen.<br />
723         /// </summary>
724         /// <param name="view">The view to animate.</param>
725         /// <param name="path">It defines position and orientation.</param>
726         /// <param name="forward">The vector (in local space coordinate system) will be oriented with the path's tangent direction.</param>
727         /// <param name="alphaFunction">The alpha function to apply.</param>
728         /// <since_tizen> 3 </since_tizen>
729         public void AnimatePath(View view, Path path, Vector3 forward, AlphaFunction alphaFunction = null)
730         {
731             if (alphaFunction == null)
732             {
733                 Animate(view, path, forward);
734             }
735             else
736             {
737                 Animate(view, path, forward, alphaFunction);
738             }
739         }
740
741         /// <summary>
742         /// Animates the view's position and orientation through a predefined path.<br />
743         /// The view will rotate to orient the supplied forward vector with the path's tangent.<br />
744         /// If forward is the zero vector then no rotation will happen.<br />
745         /// </summary>
746         /// <param name="view">The view to animate.</param>
747         /// <param name="path">It defines position and orientation.</param>
748         /// <param name="forward">The vector (in local space coordinate system) will be oriented with the path's tangent direction.</param>
749         /// <param name="startTime">The start time of the animation.</param>
750         /// <param name="endTime">The end time of the animation.</param>
751         /// <param name="alphaFunction">The alpha function to apply.</param>
752         /// <since_tizen> 3 </since_tizen>
753         public void AnimatePath(View view, Path path, Vector3 forward, int startTime, int endTime, AlphaFunction alphaFunction = null)
754         {
755             TimePeriod time = new TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
756             if (alphaFunction == null)
757             {
758                 Animate(view, path, forward, time);
759             }
760             else
761             {
762                 Animate(view, path, forward, alphaFunction, time);
763             }
764         }
765
766         /// <summary>
767         /// Creates an initialized animation.<br />
768         /// The animation will not loop.<br />
769         /// The default end action is "Cancel".<br />
770         /// The default alpha function is linear.<br />
771         /// </summary>
772         /// <since_tizen> 3 </since_tizen>
773         public Animation() : this(Interop.Animation.Animation_New(0.0f), true)
774         {
775             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
776         }
777
778         /// <summary>
779         /// Plays the animation.
780         /// </summary>
781         /// <since_tizen> 3 </since_tizen>
782         public void Play()
783         {
784             Interop.Animation.Animation_Play(swigCPtr);
785             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
786
787             if (DisableAnimation == true)
788                 Stop(EndActions.StopFinal);
789         }
790
791         /// <summary>
792         /// Plays the animation from a given point.<br />
793         /// The progress must be in the 0-1 interval or in the play range interval if defined,
794         /// otherwise, it will be ignored.<br />
795         /// </summary>
796         /// <param name="progress">A value between [0,1], or between the play range if specified, from where the animation should start playing.</param>
797         /// <since_tizen> 3 </since_tizen>
798         public void PlayFrom(float progress)
799         {
800             Interop.Animation.Animation_PlayFrom(swigCPtr, progress);
801             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
802         }
803
804         /// <summary>
805         /// Plays the animation after a given delay time.<br/>
806         /// The delay time is not included in the looping time.<br/>
807         /// When the delay time is a negative value, it would treat as play immediately.<br/>
808         /// </summary>
809         /// <param name="delayMilliseconds">The delay time.</param>
810         /// <since_tizen> 4 </since_tizen>
811         public void PlayAfter(int delayMilliseconds)
812         {
813             Interop.Animation.Animation_PlayAfter(swigCPtr, MilliSecondsToSeconds(delayMilliseconds));
814             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
815         }
816
817         /// <summary>
818         /// Pauses the animation.
819         /// </summary>
820         /// <since_tizen> 3 </since_tizen>
821         public void Pause()
822         {
823             Interop.Animation.Animation_Pause(swigCPtr);
824             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
825         }
826
827         /// <summary>
828         /// Stops the animation.
829         /// </summary>
830         /// <since_tizen> 3 </since_tizen>
831         public void Stop()
832         {
833             Interop.Animation.Animation_Stop(swigCPtr);
834             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
835         }
836
837         /// <summary>
838         /// Clears the animation.<br />
839         /// This disconnects any objects that were being animated, effectively stopping the animation.<br />
840         /// </summary>
841         /// <since_tizen> 3 </since_tizen>
842         public void Clear()
843         {
844             Interop.Animation.Animation_Clear(swigCPtr);
845             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
846         }
847
848         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Animation obj)
849         {
850             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
851         }
852
853         internal object ConvertTo(object value, Type toType)
854         {
855             Func<object> getConverter = () =>
856             {
857                 string converterTypeName = GetTypeConverterTypeName(toType.GetTypeInfo().CustomAttributes);
858                 if (converterTypeName == null)
859                     return null;
860
861                 Type convertertype = Type.GetType(converterTypeName);
862                 return Activator.CreateInstance(convertertype);
863             };
864
865             return ConvertTo(value, toType, getConverter);
866         }
867
868         internal object ConvertTo(object value, Type toType, Func<object> getConverter)
869         {
870             if (value == null)
871                 return null;
872
873             var str = value as string;
874             if (str != null)
875             {
876                 //If there's a [TypeConverter], use it
877                 object converter = getConverter?.Invoke();
878                 var xfTypeConverter = converter as Tizen.NUI.Binding.TypeConverter;
879                 if (xfTypeConverter != null)
880                     return value = xfTypeConverter.ConvertFromInvariantString(str);
881                 var converterType = converter?.GetType();
882                 if (converterType != null)
883                 {
884                     var convertFromStringInvariant = converterType.GetRuntimeMethod("ConvertFromInvariantString",
885                         new[] { typeof(string) });
886                     if (convertFromStringInvariant != null)
887                         return value = convertFromStringInvariant.Invoke(converter, new object[] { str });
888                 }
889
890                 //If the type is nullable, as the value is not null, it's safe to assume we want the built-in conversion
891                 if (toType.GetTypeInfo().IsGenericType && toType.GetGenericTypeDefinition() == typeof(Nullable<>))
892                     toType = Nullable.GetUnderlyingType(toType);
893
894                 //Obvious Built-in conversions
895                 if (toType.GetTypeInfo().IsEnum)
896                     return Enum.Parse(toType, str, true);
897                 if (toType == typeof(SByte))
898                     return SByte.Parse(str, CultureInfo.InvariantCulture);
899                 if (toType == typeof(Int16))
900                     return Int16.Parse(str, CultureInfo.InvariantCulture);
901                 if (toType == typeof(Int32))
902                     return Int32.Parse(str, CultureInfo.InvariantCulture);
903                 if (toType == typeof(Int64))
904                     return Int64.Parse(str, CultureInfo.InvariantCulture);
905                 if (toType == typeof(Byte))
906                     return Byte.Parse(str, CultureInfo.InvariantCulture);
907                 if (toType == typeof(UInt16))
908                     return UInt16.Parse(str, CultureInfo.InvariantCulture);
909                 if (toType == typeof(UInt32))
910                     return UInt32.Parse(str, CultureInfo.InvariantCulture);
911                 if (toType == typeof(UInt64))
912                     return UInt64.Parse(str, CultureInfo.InvariantCulture);
913                 if (toType == typeof(Single))
914                     return Single.Parse(str, CultureInfo.InvariantCulture);
915                 if (toType == typeof(Double))
916                     return Double.Parse(str, CultureInfo.InvariantCulture);
917                 if (toType == typeof(Boolean))
918                     return Boolean.Parse(str);
919                 if (toType == typeof(TimeSpan))
920                     return TimeSpan.Parse(str, CultureInfo.InvariantCulture);
921                 if (toType == typeof(DateTime))
922                     return DateTime.Parse(str, CultureInfo.InvariantCulture);
923                 if (toType == typeof(Char))
924                 {
925                     char c = '\0';
926                     Char.TryParse(str, out c);
927                     return c;
928                 }
929                 if (toType == typeof(String) && str.StartsWith("{}", StringComparison.Ordinal))
930                     return str.Substring(2);
931                 if (toType == typeof(String))
932                     return value;
933                 if (toType == typeof(Decimal))
934                     return Decimal.Parse(str, CultureInfo.InvariantCulture);
935             }
936
937             //if the value is not assignable and there's an implicit conversion, convert
938             if (value != null && !toType.IsAssignableFrom(value.GetType()))
939             {
940                 var opImplicit = GetImplicitConversionOperator(value.GetType(), value.GetType(), toType)
941                                  ?? GetImplicitConversionOperator(toType, value.GetType(), toType);
942                 //var opImplicit = value.GetType().GetImplicitConversionOperator(fromType: value.GetType(), toType: toType)
943                 //                ?? toType.GetImplicitConversionOperator(fromType: value.GetType(), toType: toType);
944
945                 if (opImplicit != null)
946                 {
947                     value = opImplicit.Invoke(null, new[] { value });
948                     return value;
949                 }
950             }
951
952             return value;
953         }
954
955         internal string GetTypeConverterTypeName(IEnumerable<CustomAttributeData> attributes)
956         {
957             var converterAttribute =
958                 attributes.FirstOrDefault(cad => Tizen.NUI.Binding.TypeConverterAttribute.TypeConvertersType.Contains(cad.AttributeType.FullName));
959             if (converterAttribute == null)
960                 return null;
961             if (converterAttribute.ConstructorArguments[0].ArgumentType == typeof(string))
962                 return (string)converterAttribute.ConstructorArguments[0].Value;
963             if (converterAttribute.ConstructorArguments[0].ArgumentType == typeof(Type))
964                 return ((Type)converterAttribute.ConstructorArguments[0].Value).AssemblyQualifiedName;
965             return null;
966         }
967
968         internal MethodInfo GetImplicitConversionOperator(Type onType, Type fromType, Type toType)
969         {
970 #if NETSTANDARD1_0
971             var mi = onType.GetRuntimeMethod("op_Implicit", new[] { fromType });
972 #else
973             var bindingFlags = BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy;
974             var mi = onType.GetMethod("op_Implicit", bindingFlags, null, new[] { fromType }, null);
975 #endif
976             if (mi == null) return null;
977             if (!mi.IsSpecialName) return null;
978             if (!mi.IsPublic) return null;
979             if (!mi.IsStatic) return null;
980             if (!toType.IsAssignableFrom(mi.ReturnType)) return null;
981
982             return mi;
983         }
984
985         internal Animation(float durationSeconds) : this(Interop.Animation.Animation_New(durationSeconds), true)
986         {
987             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
988
989         }
990
991         internal Animation(Animation handle) : this(Interop.Animation.new_Animation__SWIG_1(Animation.getCPtr(handle)), true)
992         {
993             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
994         }
995
996         internal Animation Assign(Animation rhs)
997         {
998             Animation ret = new Animation(Interop.Animation.Animation_Assign(swigCPtr, Animation.getCPtr(rhs)), false);
999             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1000             return ret;
1001         }
1002
1003         internal void SetDuration(float seconds)
1004         {
1005             Interop.Animation.Animation_SetDuration(swigCPtr, seconds);
1006             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1007         }
1008
1009         internal float GetDuration()
1010         {
1011             float ret = Interop.Animation.Animation_GetDuration(swigCPtr);
1012             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1013             return ret;
1014         }
1015
1016         internal void SetLooping(bool looping)
1017         {
1018             Interop.Animation.Animation_SetLooping(swigCPtr, looping);
1019             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1020         }
1021
1022         internal void SetLoopCount(int count)
1023         {
1024             Interop.Animation.Animation_SetLoopCount(swigCPtr, count);
1025             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1026         }
1027
1028         internal int GetLoopCount()
1029         {
1030             int ret = Interop.Animation.Animation_GetLoopCount(swigCPtr);
1031             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1032             return ret;
1033         }
1034
1035         internal int GetCurrentLoop()
1036         {
1037             int ret = Interop.Animation.Animation_GetCurrentLoop(swigCPtr);
1038             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1039             return ret;
1040         }
1041
1042         internal bool IsLooping()
1043         {
1044             bool ret = Interop.Animation.Animation_IsLooping(swigCPtr);
1045             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1046             return ret;
1047         }
1048
1049         internal void SetEndAction(Animation.EndActions action)
1050         {
1051             Interop.Animation.Animation_SetEndAction(swigCPtr, (int)action);
1052             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1053         }
1054
1055         internal Animation.EndActions GetEndAction()
1056         {
1057             Animation.EndActions ret = (Animation.EndActions)Interop.Animation.Animation_GetEndAction(swigCPtr);
1058             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1059             return ret;
1060         }
1061
1062         internal void SetDisconnectAction(Animation.EndActions disconnectAction)
1063         {
1064             Interop.Animation.Animation_SetDisconnectAction(swigCPtr, (int)disconnectAction);
1065             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1066         }
1067
1068         internal Animation.EndActions GetDisconnectAction()
1069         {
1070             Animation.EndActions ret = (Animation.EndActions)Interop.Animation.Animation_GetDisconnectAction(swigCPtr);
1071             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1072             return ret;
1073         }
1074
1075         internal void SetDefaultAlphaFunction(AlphaFunction alpha)
1076         {
1077             Interop.Animation.Animation_SetDefaultAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alpha));
1078             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1079         }
1080
1081         internal AlphaFunction GetDefaultAlphaFunction()
1082         {
1083             AlphaFunction ret = new AlphaFunction(Interop.Animation.Animation_GetDefaultAlphaFunction(swigCPtr), true);
1084             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1085             return ret;
1086         }
1087
1088         internal void SetCurrentProgress(float progress)
1089         {
1090             Interop.Animation.Animation_SetCurrentProgress(swigCPtr, progress);
1091             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1092         }
1093
1094         internal float GetCurrentProgress()
1095         {
1096             float ret = Interop.Animation.Animation_GetCurrentProgress(swigCPtr);
1097             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1098             return ret;
1099         }
1100
1101         internal void SetSpeedFactor(float factor)
1102         {
1103             Interop.Animation.Animation_SetSpeedFactor(swigCPtr, factor);
1104             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1105         }
1106
1107         internal float GetSpeedFactor()
1108         {
1109             float ret = Interop.Animation.Animation_GetSpeedFactor(swigCPtr);
1110             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1111             return ret;
1112         }
1113
1114         internal void SetPlayRange(Vector2 range)
1115         {
1116             Interop.Animation.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(range));
1117             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1118         }
1119
1120         internal Vector2 GetPlayRange()
1121         {
1122             Vector2 ret = new Vector2(Interop.Animation.Animation_GetPlayRange(swigCPtr), true);
1123             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1124             return ret;
1125         }
1126
1127         internal Animation.States GetState()
1128         {
1129             Animation.States ret = (Animation.States)Interop.Animation.Animation_GetState(swigCPtr);
1130             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1131             return ret;
1132         }
1133
1134         internal AnimationSignal FinishedSignal()
1135         {
1136             AnimationSignal ret = new AnimationSignal(Interop.Animation.Animation_FinishedSignal(swigCPtr), false);
1137             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1138             return ret;
1139         }
1140
1141         internal AnimationSignal ProgressReachedSignal()
1142         {
1143             AnimationSignal ret = new AnimationSignal(Interop.Animation.Animation_ProgressReachedSignal(swigCPtr), false);
1144             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1145             return ret;
1146         }
1147
1148         internal void AnimateBy(Property target, PropertyValue relativeValue)
1149         {
1150             Interop.Animation.Animation_AnimateBy__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue));
1151             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1152         }
1153
1154         internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha)
1155         {
1156             Interop.Animation.Animation_AnimateBy__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha));
1157             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1158         }
1159
1160         internal void AnimateBy(Property target, PropertyValue relativeValue, TimePeriod period)
1161         {
1162             Interop.Animation.Animation_AnimateBy__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), TimePeriod.getCPtr(period));
1163             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1164         }
1165
1166         internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha, TimePeriod period)
1167         {
1168             Interop.Animation.Animation_AnimateBy__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1169             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1170         }
1171
1172         internal void AnimateTo(Property target, PropertyValue destinationValue)
1173         {
1174             Interop.Animation.Animation_AnimateTo__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue));
1175             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1176         }
1177
1178         internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha)
1179         {
1180             Interop.Animation.Animation_AnimateTo__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha));
1181             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1182         }
1183
1184         internal void AnimateTo(Property target, PropertyValue destinationValue, TimePeriod period)
1185         {
1186             Interop.Animation.Animation_AnimateTo__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), TimePeriod.getCPtr(period));
1187             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1188         }
1189
1190         internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha, TimePeriod period)
1191         {
1192             Interop.Animation.Animation_AnimateTo__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1193             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1194         }
1195
1196         internal void AnimateBetween(Property target, KeyFrames keyFrames)
1197         {
1198             Interop.Animation.Animation_AnimateBetween__SWIG_0(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames));
1199             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1200         }
1201
1202         internal void AnimateBetween(Property target, KeyFrames keyFrames, Animation.Interpolation interpolation)
1203         {
1204             Interop.Animation.Animation_AnimateBetween__SWIG_1(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), (int)interpolation);
1205             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1206         }
1207
1208         internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha)
1209         {
1210             Interop.Animation.Animation_AnimateBetween__SWIG_2(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha));
1211             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1212         }
1213
1214         internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, Animation.Interpolation interpolation)
1215         {
1216             Interop.Animation.Animation_AnimateBetween__SWIG_3(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), (int)interpolation);
1217             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1218         }
1219
1220         internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period)
1221         {
1222             Interop.Animation.Animation_AnimateBetween__SWIG_4(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period));
1223             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1224         }
1225
1226         internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period, Animation.Interpolation interpolation)
1227         {
1228             Interop.Animation.Animation_AnimateBetween__SWIG_5(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period), (int)interpolation);
1229             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1230         }
1231
1232         internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period)
1233         {
1234             Interop.Animation.Animation_AnimateBetween__SWIG_6(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1235             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1236         }
1237
1238         internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Animation.Interpolation interpolation)
1239         {
1240             Interop.Animation.Animation_AnimateBetween__SWIG_7(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period), (int)interpolation);
1241             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1242         }
1243
1244         internal void Animate(View view, Path path, Vector3 forward)
1245         {
1246             Interop.Animation.Animation_Animate__SWIG_0(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward));
1247             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1248         }
1249
1250         internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha)
1251         {
1252             Interop.Animation.Animation_Animate__SWIG_1(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha));
1253             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1254         }
1255
1256         internal void Animate(View view, Path path, Vector3 forward, TimePeriod period)
1257         {
1258             Interop.Animation.Animation_Animate__SWIG_2(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), TimePeriod.getCPtr(period));
1259             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1260         }
1261
1262         internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha, TimePeriod period)
1263         {
1264             Interop.Animation.Animation_Animate__SWIG_3(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1265             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1266         }
1267
1268         internal void Show(View view, float delaySeconds)
1269         {
1270             Interop.Animation.Animation_Show(swigCPtr, View.getCPtr(view), delaySeconds);
1271             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1272         }
1273
1274         internal void Hide(View view, float delaySeconds)
1275         {
1276             Interop.Animation.Animation_Hide(swigCPtr, View.getCPtr(view), delaySeconds);
1277             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1278         }
1279
1280         /// <summary>
1281         /// To make animation instance be disposed.
1282         /// </summary>
1283         /// <since_tizen> 3 </since_tizen>
1284         protected override void Dispose(DisposeTypes type)
1285         {
1286             if (disposed)
1287             {
1288                 return;
1289             }
1290
1291             if (_finishedCallbackOfNative != null)
1292             {
1293                 FinishedSignal().Disconnect(_finishedCallbackOfNative);
1294             }
1295
1296             if (_animationProgressReachedEventCallback != null)
1297             {
1298
1299                 ProgressReachedSignal().Disconnect(_animationProgressReachedEventCallback);
1300             }
1301
1302             base.Dispose(type);
1303         }
1304
1305         /// This will not be public opened.
1306         [EditorBrowsable(EditorBrowsableState.Never)]
1307         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
1308         {
1309             Interop.Animation.delete_Animation(swigCPtr);
1310         }
1311
1312         private void OnFinished(IntPtr data)
1313         {
1314             if (_animationFinishedEventHandler != null)
1315             {
1316                 //here we send all data to user event handlers
1317                 _animationFinishedEventHandler(this, null);
1318             }
1319         }
1320
1321         private void OnProgressReached(IntPtr data)
1322         {
1323             if (_animationProgressReachedEventHandler != null)
1324             {
1325                 //here we send all data to user event handlers
1326                 _animationProgressReachedEventHandler(this, null);
1327             }
1328         }
1329
1330         private float MilliSecondsToSeconds(int millisec)
1331         {
1332             return (float)millisec / 1000.0f;
1333         }
1334
1335         private int SecondsToMilliSeconds(float sec)
1336         {
1337             return (int)(sec * 1000);
1338         }
1339
1340         private object AvoidFloatPropertyHasIntegerValue(View target, Property property, object value)
1341         {
1342             PropertyType propertyType = target.GetPropertyType(property.propertyIndex);
1343             if (propertyType.Equals(PropertyType.Float))
1344             {
1345                 System.Type type = value.GetType();
1346                 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
1347                 {
1348                     int num = (int)value;
1349                     value = (float)num;
1350                 }
1351             }
1352             return value;
1353         }
1354     }
1355 }