[NUI] Remove Transition for xaml
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / View.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 using System;
18 using System.Collections.Generic;
19 using System.ComponentModel;
20 using System.Runtime.InteropServices;
21 using Tizen.NUI.Binding;
22 using Tizen.NUI.Components;
23
24 namespace Tizen.NUI.BaseComponents
25 {
26     /// <summary>
27     /// View is the base class for all views.
28     /// </summary>
29     /// <since_tizen> 3 </since_tizen>
30     public partial class View : Container, IResourcesProvider
31     {
32         internal BackgroundExtraData backgroundExtraData;
33
34         private bool layoutSet = false;
35         private LayoutItem layout; // Exclusive layout assigned to this View.
36
37         // List of transitions paired with the condition that uses the transition.
38         private Dictionary<TransitionCondition, TransitionList> layoutTransitions;
39         private int widthPolicy = LayoutParamPolicies.WrapContent; // Layout width policy
40         private int heightPolicy = LayoutParamPolicies.WrapContent; // Layout height policy
41         private float weight = 0.0f; // Weighting of child View in a Layout
42         private bool backgroundImageSynchronosLoading = false;
43         private bool controlStatePropagation = false;
44         private ViewStyle viewStyle;
45         private bool themeChangeSensitive = false;
46         private bool excludeLayouting = false;
47         private LayoutTransition layoutTransition;
48         private ControlState controlStates = ControlState.Normal;
49
50         static View() { }
51
52         /// <summary>
53         /// Creates a new instance of a view.
54         /// </summary>
55         /// <since_tizen> 3 </since_tizen>
56         public View() : this(Interop.View.New(), true)
57         {
58             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
59         }
60
61         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
62         [EditorBrowsable(EditorBrowsableState.Never)]
63         public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
64         {
65         }
66
67         /// <summary>
68         /// Create a new instance of a View with setting the status of shown or hidden.
69         /// </summary>
70         /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
71         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
72         [EditorBrowsable(EditorBrowsableState.Never)]
73         public View(bool shown) : this(Interop.View.New(), true)
74         {
75             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
76             SetVisible(shown);
77         }
78
79         internal View(View uiControl, bool shown = true) : this(Interop.View.NewView(View.getCPtr(uiControl)), true)
80         {
81             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
82             if (!shown)
83             {
84                 SetVisible(false);
85             }
86
87             backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
88         }
89
90         internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
91         {
92             InitializeStyle(viewStyle);
93         }
94
95         internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn)
96         {
97             if (HasBody())
98             {
99                 PositionUsesPivotPoint = false;
100             }
101
102             onWindowSendEventCallback = SendViewAddedEventToWindow;
103             this.OnWindowSignal().Connect(onWindowSendEventCallback);
104
105             if (!shown)
106             {
107                 SetVisible(false);
108             }
109         }
110
111         internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
112         {
113             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
114
115             if (!shown)
116             {
117                 SetVisible(false);
118             }
119         }
120
121         /// <summary>
122         /// The event that is triggered when the View's ControlState is changed.
123         /// </summary>
124         [EditorBrowsable(EditorBrowsableState.Never)]
125         public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
126
127         internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
128
129
130         /// <summary>
131         /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
132         /// </summary>
133         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
134         [EditorBrowsable(EditorBrowsableState.Never)]
135         public bool LayoutSet
136         {
137             get
138             {
139                 return layoutSet;
140             }
141         }
142
143         /// <summary>
144         /// Flag to allow Layouting to be disabled for Views.
145         /// Once a View has a Layout set then any children added to Views from then on will receive
146         /// automatic Layouts.
147         /// </summary>
148         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
149         [EditorBrowsable(EditorBrowsableState.Never)]
150         public static bool LayoutingDisabled { get; set; } = true;
151
152         /// <summary>
153         /// The style instance applied to this view.
154         /// Note that please do not modify the ViewStyle.
155         /// Modifying ViewStyle will affect other views with same ViewStyle.
156         /// </summary>
157         [EditorBrowsable(EditorBrowsableState.Never)]
158         protected ViewStyle ViewStyle
159         {
160             get
161             {
162                 if (null == viewStyle)
163                 {
164                     ApplyStyle(CreateViewStyle());
165                 }
166
167                 return viewStyle;
168             }
169         }
170
171         /// <summary>
172         /// Get/Set the control state.
173         /// Note that the ControlState only available for the classes derived from Control.
174         /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
175         /// please set <see cref="EnableControlState"/> to true.
176         /// </summary>
177         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
178         [EditorBrowsable(EditorBrowsableState.Never)]
179         public ControlState ControlState
180         {
181             get
182             {
183                 return controlStates;
184             }
185             protected set
186             {
187                 if (controlStates == value)
188                 {
189                     return;
190                 }
191
192                 var prevState = controlStates;
193
194                 controlStates = value;
195
196                 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
197
198                 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
199
200                 if (controlStatePropagation)
201                 {
202                     foreach (View child in Children)
203                     {
204                         child.ControlState = value;
205                     }
206                 }
207
208                 OnControlStateChanged(changeInfo);
209
210                 ControlStateChangedEvent?.Invoke(this, changeInfo);
211             }
212         }
213
214         /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API.
215         [EditorBrowsable(EditorBrowsableState.Never)]
216         public bool ExcludeLayouting
217         {
218             get
219             {
220                 return excludeLayouting;
221             }
222             set
223             {
224                 excludeLayouting = value;
225                 if (Layout != null && Layout.SetPositionByLayout == value)
226                 {
227                     Layout.SetPositionByLayout = !value;
228                     Layout.RequestLayout();
229                 }
230             }
231         }
232
233         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
234         [EditorBrowsable(EditorBrowsableState.Never)]
235         public bool IsResourcesCreated
236         {
237             get
238             {
239                 return Application.Current.IsResourcesCreated;
240             }
241         }
242
243         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
244         [EditorBrowsable(EditorBrowsableState.Never)]
245         public ResourceDictionary XamlResources
246         {
247             get
248             {
249                 return Application.Current.XamlResources;
250             }
251             set
252             {
253                 Application.Current.XamlResources = value;
254             }
255         }
256
257         /// <summary>
258         /// The StyleName, type string.
259         /// The value indicates DALi style name defined in json theme file.
260         /// </summary>
261         /// <since_tizen> 3 </since_tizen>
262         public string StyleName
263         {
264             get
265             {
266                 return (string)GetValue(StyleNameProperty);
267             }
268             set
269             {
270                 SetValue(StyleNameProperty, value);
271                 NotifyPropertyChanged();
272             }
273         }
274
275         /// <summary>
276         /// The KeyInputFocus, type bool.
277         /// </summary>
278         [EditorBrowsable(EditorBrowsableState.Never)]
279         public bool KeyInputFocus
280         {
281             get
282             {
283                 return (bool)GetValue(KeyInputFocusProperty);
284             }
285             set
286             {
287                 SetValue(KeyInputFocusProperty, value);
288                 NotifyPropertyChanged();
289             }
290         }
291
292         /// <summary>
293         /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
294         /// </summary>
295         /// <remarks>
296         /// <para>
297         /// The property cascade chaining set is possible. For example, this (view.BackgroundColor.X = 0.1f;) is possible.
298         /// </para>
299         /// <para>
300         /// Animatable - This property can be animated using <c>Animation</c> class.
301         /// <code>
302         /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
303         /// </code>
304         /// </para>
305         /// </remarks>
306         /// <since_tizen> 3 </since_tizen>
307         public Color BackgroundColor
308         {
309             get
310             {
311                 Color temp = (Color)GetValue(BackgroundColorProperty);
312                 return new Color(OnBackgroundColorChanged, temp.R, temp.G, temp.B, temp.A);
313             }
314             set
315             {
316                 SetValue(BackgroundColorProperty, value);
317                 if (selectorData != null)
318                 {
319                     selectorData.BackgroundImage?.Reset(this);
320                     selectorData.BackgroundColor?.Reset(this);
321                 }
322                 NotifyPropertyChanged();
323             }
324         }
325
326         /// <summary>
327         /// The mutually exclusive with "backgroundColor" and "background" type Map.
328         /// </summary>
329         /// <since_tizen> 3 </since_tizen>
330         public string BackgroundImage
331         {
332             get
333             {
334                 return (string)GetValue(BackgroundImageProperty);
335             }
336             set
337             {
338                 SetValue(BackgroundImageProperty, value);
339                 if (selectorData != null)
340                 {
341                     selectorData.BackgroundColor?.Reset(this);
342                     selectorData.BackgroundImage?.Reset(this);
343                 }
344                 NotifyPropertyChanged();
345             }
346         }
347
348         /// <summary>
349         /// Get or set the border of background image.
350         /// </summary>
351         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
352         [EditorBrowsable(EditorBrowsableState.Never)]
353         public Rectangle BackgroundImageBorder
354         {
355             get
356             {
357                 return (Rectangle)GetValue(BackgroundImageBorderProperty);
358             }
359             set
360             {
361                 SetValue(BackgroundImageBorderProperty, value);
362                 selectorData?.BackgroundImageBorder?.Reset(this);
363                 NotifyPropertyChanged();
364             }
365         }
366
367         /// <summary>
368         /// The background of view.
369         /// </summary>
370         /// <since_tizen> 3 </since_tizen>
371         public Tizen.NUI.PropertyMap Background
372         {
373             get
374             {
375                 return (PropertyMap)GetValue(BackgroundProperty);
376             }
377             set
378             {
379                 SetValue(BackgroundProperty, value);
380                 NotifyPropertyChanged();
381             }
382         }
383
384         /// <summary>
385         /// Describes a shadow as an image for a View.
386         /// It is null by default.
387         /// </summary>
388         /// <remarks>
389         /// Getter returns copied instance of current shadow.
390         /// </remarks>
391         /// <remarks>
392         /// The mutually exclusive with "BoxShadow".
393         /// </remarks>
394         /// <remarks>
395         /// <para>
396         /// Animatable - This property can be animated using <c>Animation</c> class.
397         /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
398         /// <code>
399         /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
400         /// </code>
401         /// Animatable sub-property : Offset.
402         /// </para>
403         /// </remarks>
404         [EditorBrowsable(EditorBrowsableState.Never)]
405         public ImageShadow ImageShadow
406         {
407             get
408             {
409                 return (ImageShadow)GetValue(ImageShadowProperty);
410             }
411             set
412             {
413                 SetValue(ImageShadowProperty, value);
414                 if (selectorData != null)
415                 {
416                     selectorData.BoxShadow?.Reset(this);
417                     selectorData.ImageShadow?.Reset(this);
418                 }
419                 NotifyPropertyChanged();
420             }
421         }
422
423         /// <summary>
424         /// Describes a box shaped shadow drawing for a View.
425         /// It is null by default.
426         /// </summary>
427         /// <remarks>
428         /// Getter returns copied instance of current shadow.
429         /// </remarks>
430         /// <remarks>
431         /// The mutually exclusive with "ImageShadow".
432         /// </remarks>
433         /// <remarks>
434         /// <para>
435         /// Animatable - This property can be animated using <c>Animation</c> class.
436         /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
437         /// <code>
438         /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
439         /// </code>
440         /// Animatable sub-property : Offset, Color, BlurRadius.
441         /// </para>
442         /// </remarks>
443         [EditorBrowsable(EditorBrowsableState.Never)]
444         public Shadow BoxShadow
445         {
446             get
447             {
448                 return (Shadow)GetValue(BoxShadowProperty);
449             }
450             set
451             {
452                 SetValue(BoxShadowProperty, value);
453                 if (selectorData != null)
454                 {
455                     selectorData.ImageShadow?.Reset(this);
456                     selectorData.BoxShadow?.Reset(this);
457                 }
458                 NotifyPropertyChanged();
459             }
460         }
461
462         /// <summary>
463         /// The radius for the rounded corners of the View.
464         /// This will rounds background and shadow edges.
465         /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
466         /// </summary>
467         /// <remarks>
468         /// <para>
469         /// Animatable - This property can be animated using <c>Animation</c> class.
470         /// </para>
471         /// </remarks>
472         [EditorBrowsable(EditorBrowsableState.Never)]
473         public float CornerRadius
474         {
475             get
476             {
477                 return (float)GetValue(CornerRadiusProperty);
478             }
479             set
480             {
481                 SetValue(CornerRadiusProperty, value);
482                 NotifyPropertyChanged();
483             }
484         }
485
486         //
487         // Accessibility
488         //
489
490         [EditorBrowsable(EditorBrowsableState.Never)]
491         protected bool IsHighlighted
492         {
493             get
494             {
495                 return Accessibility.AccessibilityManager.Instance.GetCurrentFocusView() == this;
496             }
497         }
498
499         [EditorBrowsable(EditorBrowsableState.Never)]
500         protected static readonly string AccessibilityActivateAction = "activate";
501         [EditorBrowsable(EditorBrowsableState.Never)]
502         protected static readonly string AccessibilityReadingSkippedAction = "ReadingSkipped";
503         [EditorBrowsable(EditorBrowsableState.Never)]
504         protected static readonly string AccessibilityReadingCancelledAction = "ReadingCancelled";
505         [EditorBrowsable(EditorBrowsableState.Never)]
506         protected static readonly string AccessibilityReadingStoppedAction = "ReadingStopped";
507         [EditorBrowsable(EditorBrowsableState.Never)]
508         protected static readonly string AccessibilityReadingPausedAction = "ReadingPaused";
509         [EditorBrowsable(EditorBrowsableState.Never)]
510         protected static readonly string AccessibilityReadingResumedAction = "ReadingResumed";
511
512         [EditorBrowsable(EditorBrowsableState.Never)]
513         private static readonly string[] AccessibilityActions = {
514             AccessibilityActivateAction,
515             AccessibilityReadingSkippedAction,
516             AccessibilityReadingCancelledAction,
517             AccessibilityReadingStoppedAction,
518             AccessibilityReadingPausedAction,
519             AccessibilityReadingResumedAction,
520         };
521
522         [EditorBrowsable(EditorBrowsableState.Never)]
523         protected virtual string AccessibilityGetName()
524         {
525             return "";
526         }
527
528         [EditorBrowsable(EditorBrowsableState.Never)]
529         protected virtual string AccessibilityGetDescription()
530         {
531             return "";
532         }
533
534         [EditorBrowsable(EditorBrowsableState.Never)]
535         protected virtual bool AccessibilityDoAction(string name)
536         {
537             return false;
538         }
539
540         [EditorBrowsable(EditorBrowsableState.Never)]
541         protected virtual AccessibilityStates AccessibilityCalculateStates()
542         {
543             var states = new AccessibilityStates();
544             states.Set(AccessibilityState.Highlightable, this.AccessibilityHighlightable);
545             states.Set(AccessibilityState.Focusable, this.Focusable);
546             states.Set(AccessibilityState.Focused, this.State == States.Focused);
547             states.Set(AccessibilityState.Highlighted, this.IsHighlighted);
548             states.Set(AccessibilityState.Enabled, this.State != States.Disabled);
549             states.Set(AccessibilityState.Sensitive, this.Sensitive);
550             states.Set(AccessibilityState.Animated, this.AccessibilityAnimated);
551             states.Set(AccessibilityState.Visible, true);
552             states.Set(AccessibilityState.Showing, this.Visibility);
553             states.Set(AccessibilityState.Defunct, !this.IsOnWindow);
554             return states;
555         }
556
557         [EditorBrowsable(EditorBrowsableState.Never)]
558         protected virtual int AccessibilityGetActionCount()
559         {
560             return AccessibilityActions.Length;
561         }
562
563         [EditorBrowsable(EditorBrowsableState.Never)]
564         protected virtual string AccessibilityGetActionName(int index)
565         {
566             if (index >= 0 && index < AccessibilityActions.Length)
567                 return AccessibilityActions[index];
568             else
569                 return "";
570         }
571
572         [EditorBrowsable(EditorBrowsableState.Never)]
573         protected virtual bool AccessibilityShouldReportZeroChildren()
574         {
575             return false;
576         }
577
578         [EditorBrowsable(EditorBrowsableState.Never)]
579         protected virtual double AccessibilityGetMinimum()
580         {
581             return 0.0;
582         }
583
584         [EditorBrowsable(EditorBrowsableState.Never)]
585         protected virtual double AccessibilityGetCurrent()
586         {
587             return 0.0;
588         }
589
590         [EditorBrowsable(EditorBrowsableState.Never)]
591         protected virtual double AccessibilityGetMaximum()
592         {
593             return 0.0;
594         }
595
596         [EditorBrowsable(EditorBrowsableState.Never)]
597         protected virtual bool AccessibilitySetCurrent(double value)
598         {
599             return false;
600         }
601
602         [EditorBrowsable(EditorBrowsableState.Never)]
603         protected virtual double AccessibilityGetMinimumIncrement()
604         {
605             return 0.0;
606         }
607
608         [EditorBrowsable(EditorBrowsableState.Never)]
609         protected virtual bool AccessibilityIsScrollable()
610         {
611             return false;
612         }
613
614         [EditorBrowsable(EditorBrowsableState.Never)]
615         protected virtual string AccessibilityGetText(int startOffset, int endOffset)
616         {
617             return "";
618         }
619
620         [EditorBrowsable(EditorBrowsableState.Never)]
621         protected virtual int AccessibilityGetCharacterCount()
622         {
623             return 0;
624         }
625
626         [EditorBrowsable(EditorBrowsableState.Never)]
627         protected virtual int AccessibilityGetCaretOffset()
628         {
629             return 0;
630         }
631
632         [EditorBrowsable(EditorBrowsableState.Never)]
633         protected virtual bool AccessibilitySetCaretOffset(int offset)
634         {
635             return false;
636         }
637
638         [EditorBrowsable(EditorBrowsableState.Never)]
639         protected virtual AccessibilityRange AccessibilityGetTextAtOffset(int offset, TextBoundary boundary)
640         {
641             return new AccessibilityRange();
642         }
643
644         [EditorBrowsable(EditorBrowsableState.Never)]
645         protected virtual AccessibilityRange AccessibilityGetSelection(int selectionNum)
646         {
647             return new AccessibilityRange();
648         }
649
650         [EditorBrowsable(EditorBrowsableState.Never)]
651         protected virtual bool AccessibilityRemoveSelection(int selectionNum)
652         {
653             return false;
654         }
655
656         [EditorBrowsable(EditorBrowsableState.Never)]
657         protected virtual bool AccessibilitySetSelection(int selectionNum, int startOffset, int endOffset)
658         {
659             return false;
660         }
661
662         [EditorBrowsable(EditorBrowsableState.Never)]
663         protected virtual bool AccessibilityCopyText(int startPosition, int endPosition)
664         {
665             return false;
666         }
667
668         [EditorBrowsable(EditorBrowsableState.Never)]
669         protected virtual bool AccessibilityCutText(int startPosition, int endPosition)
670         {
671             return false;
672         }
673
674         /// <summary>
675         /// Whether the CornerRadius property value is relative (percentage [0.0f to 1.0f] of the view size) or absolute (in world units).
676         /// It is absolute by default.
677         /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
678         /// </summary>
679         [EditorBrowsable(EditorBrowsableState.Never)]
680         public VisualTransformPolicyType CornerRadiusPolicy
681         {
682             get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
683             set => SetValue(CornerRadiusPolicyProperty, value);
684         }
685
686         /// <summary>
687         /// The current state of the view.
688         /// </summary>
689         /// <since_tizen> 3 </since_tizen>
690         public States State
691         {
692             get
693             {
694                 return (States)GetValue(StateProperty);
695             }
696             set
697             {
698                 SetValue(StateProperty, value);
699                 NotifyPropertyChanged();
700             }
701         }
702
703         /// <summary>
704         /// The current sub state of the view.
705         /// </summary>
706         /// <since_tizen> 3 </since_tizen>
707         public States SubState
708         {
709             get
710             {
711                 return (States)GetValue(SubStateProperty);
712             }
713             set
714             {
715                 SetValue(SubStateProperty, value);
716                 NotifyPropertyChanged();
717             }
718         }
719
720         /// <summary>
721         /// Displays a tooltip
722         /// </summary>
723         /// <since_tizen> 3 </since_tizen>
724         public Tizen.NUI.PropertyMap Tooltip
725         {
726             get
727             {
728                 return (PropertyMap)GetValue(TooltipProperty);
729             }
730             set
731             {
732                 SetValue(TooltipProperty, value);
733                 NotifyPropertyChanged();
734             }
735         }
736
737         /// <summary>
738         /// Displays a tooltip as a text.
739         /// </summary>
740         /// <since_tizen> 3 </since_tizen>
741         public string TooltipText
742         {
743             get
744             {
745                 using (var propertyValue = GetProperty(Property.TOOLTIP))
746                 {
747                     if (propertyValue != null && propertyValue.Get(out string retrivedValue))
748                     {
749                         return retrivedValue;
750                     }
751                     NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
752                     return "error to get TooltipText";
753                 }
754             }
755             set
756             {
757                 var temp = new Tizen.NUI.PropertyValue(value);
758                 SetProperty(View.Property.TOOLTIP, temp);
759                 temp.Dispose();
760                 NotifyPropertyChanged();
761             }
762         }
763
764         /// <summary>
765         /// The Child property of FlexContainer.<br />
766         /// The proportion of the free space in the container, the flex item will receive.<br />
767         /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
768         /// </summary>
769         /// <since_tizen> 3 </since_tizen>
770         [Obsolete("Deprecated in API8, will be removed in API10.")]
771         public float Flex
772         {
773             get
774             {
775                 return (float)GetValue(FlexProperty);
776             }
777             set
778             {
779                 SetValue(FlexProperty, value);
780                 NotifyPropertyChanged();
781             }
782         }
783
784         /// <summary>
785         /// The Child property of FlexContainer.<br />
786         /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
787         /// </summary>
788         /// <since_tizen> 3 </since_tizen>
789         [Obsolete("Deprecated in API8, will be removed in API10.")]
790         public int AlignSelf
791         {
792             get
793             {
794                 return (int)GetValue(AlignSelfProperty);
795             }
796             set
797             {
798                 SetValue(AlignSelfProperty, value);
799                 NotifyPropertyChanged();
800             }
801         }
802
803         /// <summary>
804         /// The Child property of FlexContainer.<br />
805         /// The space around the flex item.<br />
806         /// </summary>
807         /// <remarks>
808         /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
809         /// </remarks>
810         /// <since_tizen> 3 </since_tizen>
811         [Obsolete("Deprecated in API8, will be removed in API10.")]
812         public Vector4 FlexMargin
813         {
814             get
815             {
816                 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
817                 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
818             }
819             set
820             {
821                 SetValue(FlexMarginProperty, value);
822                 NotifyPropertyChanged();
823             }
824         }
825
826         /// <summary>
827         /// The top-left cell this child occupies, if not set, the first available cell is used.
828         /// </summary>
829         /// <remarks>
830         /// The property cascade chaining set is possible. For example, this (view.CellIndex.X = 0.1f;) is possible.
831         /// </remarks>
832         /// <since_tizen> 3 </since_tizen>
833         public Vector2 CellIndex
834         {
835             get
836             {
837                 Vector2 temp = (Vector2)GetValue(CellIndexProperty);
838                 return new Vector2(OnCellIndexChanged, temp.X, temp.Y);
839             }
840             set
841             {
842                 SetValue(CellIndexProperty, value);
843                 NotifyPropertyChanged();
844             }
845         }
846
847         /// <summary>
848         /// The number of rows this child occupies, if not set, the default value is 1.
849         /// </summary>
850         /// <since_tizen> 3 </since_tizen>
851         public float RowSpan
852         {
853             get
854             {
855                 return (float)GetValue(RowSpanProperty);
856             }
857             set
858             {
859                 SetValue(RowSpanProperty, value);
860                 NotifyPropertyChanged();
861             }
862         }
863
864         /// <summary>
865         /// The number of columns this child occupies, if not set, the default value is 1.
866         /// </summary>
867         /// <since_tizen> 3 </since_tizen>
868         public float ColumnSpan
869         {
870             get
871             {
872                 return (float)GetValue(ColumnSpanProperty);
873             }
874             set
875             {
876                 SetValue(ColumnSpanProperty, value);
877                 NotifyPropertyChanged();
878             }
879         }
880
881         /// <summary>
882         /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
883         /// </summary>
884         /// <since_tizen> 3 </since_tizen>
885         public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
886         {
887             get
888             {
889                 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
890             }
891             set
892             {
893                 SetValue(CellHorizontalAlignmentProperty, value);
894                 NotifyPropertyChanged();
895             }
896         }
897
898         /// <summary>
899         /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
900         /// </summary>
901         /// <since_tizen> 3 </since_tizen>
902         public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
903         {
904             get
905             {
906                 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
907             }
908             set
909             {
910                 SetValue(CellVerticalAlignmentProperty, value);
911                 NotifyPropertyChanged();
912             }
913         }
914
915         /// <summary>
916         /// The left focusable view.<br />
917         /// This will return null if not set.<br />
918         /// This will also return null if the specified left focusable view is not on a window.<br />
919         /// </summary>
920         /// <since_tizen> 3 </since_tizen>
921         public View LeftFocusableView
922         {
923             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
924             get
925             {
926                 return (View)GetValue(LeftFocusableViewProperty);
927             }
928             set
929             {
930                 SetValue(LeftFocusableViewProperty, value);
931                 NotifyPropertyChanged();
932             }
933         }
934
935         /// <summary>
936         /// The right focusable view.<br />
937         /// This will return null if not set.<br />
938         /// This will also return null if the specified right focusable view is not on a window.<br />
939         /// </summary>
940         /// <since_tizen> 3 </since_tizen>
941         public View RightFocusableView
942         {
943             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
944             get
945             {
946                 return (View)GetValue(RightFocusableViewProperty);
947             }
948             set
949             {
950                 SetValue(RightFocusableViewProperty, value);
951                 NotifyPropertyChanged();
952             }
953         }
954
955         /// <summary>
956         /// The up focusable view.<br />
957         /// This will return null if not set.<br />
958         /// This will also return null if the specified up focusable view is not on a window.<br />
959         /// </summary>
960         /// <since_tizen> 3 </since_tizen>
961         public View UpFocusableView
962         {
963             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
964             get
965             {
966                 return (View)GetValue(UpFocusableViewProperty);
967             }
968             set
969             {
970                 SetValue(UpFocusableViewProperty, value);
971                 NotifyPropertyChanged();
972             }
973         }
974
975         /// <summary>
976         /// The down focusable view.<br />
977         /// This will return null if not set.<br />
978         /// This will also return null if the specified down focusable view is not on a window.<br />
979         /// </summary>
980         /// <since_tizen> 3 </since_tizen>
981         public View DownFocusableView
982         {
983             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
984             get
985             {
986                 return (View)GetValue(DownFocusableViewProperty);
987             }
988             set
989             {
990                 SetValue(DownFocusableViewProperty, value);
991                 NotifyPropertyChanged();
992             }
993         }
994
995         /// <summary>
996         /// Whether the view should be focusable by keyboard navigation.
997         /// </summary>
998         /// <since_tizen> 3 </since_tizen>
999         public bool Focusable
1000         {
1001             set
1002             {
1003                 SetValue(FocusableProperty, value);
1004                 NotifyPropertyChanged();
1005             }
1006             get
1007             {
1008                 return (bool)GetValue(FocusableProperty);
1009             }
1010         }
1011
1012         /// <summary>
1013         ///  Retrieves the position of the view.<br />
1014         ///  The coordinates are relative to the view's parent.<br />
1015         /// </summary>
1016         /// <since_tizen> 3 </since_tizen>
1017         public Position CurrentPosition
1018         {
1019             get
1020             {
1021                 return GetCurrentPosition();
1022             }
1023         }
1024
1025         /// <summary>
1026         /// Sets the size of a view for the width and the height.<br />
1027         /// Geometry can be scaled to fit within this area.<br />
1028         /// This does not interfere with the view's scale factor.<br />
1029         /// The views default depth is the minimum of width and height.<br />
1030         /// </summary>
1031         /// <remarks>
1032         /// This NUI object (Size2D) typed property can be configured by multiple cascade setting. <br />
1033         /// For example, this code ( view.Size2D.Width = 100; view.Size2D.Height = 100; ) is equivalent to this ( view.Size2D = new Size2D(100, 100); ). <br />
1034         /// </remarks>
1035         /// <since_tizen> 3 </since_tizen>
1036         public Size2D Size2D
1037         {
1038             get
1039             {
1040                 Size2D temp = (Size2D)GetValue(Size2DProperty);
1041                 int width = temp.Width;
1042                 int height = temp.Height;
1043
1044                 if (this.Layout == null)
1045                 {
1046                     if (width < 0) { width = 0; }
1047                     if (height < 0) { height = 0; }
1048                 }
1049
1050                 return new Size2D(OnSize2DChanged, width, height);
1051             }
1052             set
1053             {
1054                 SetValue(Size2DProperty, value);
1055
1056                 NotifyPropertyChanged();
1057             }
1058         }
1059
1060         /// <summary>
1061         ///  Retrieves the size of the view.<br />
1062         ///  The coordinates are relative to the view's parent.<br />
1063         /// </summary>
1064         /// <since_tizen> 3 </since_tizen>
1065         public Size2D CurrentSize
1066         {
1067             get
1068             {
1069                 return GetCurrentSize();
1070             }
1071         }
1072
1073         /// <summary>
1074         /// Retrieves and sets the view's opacity.<br />
1075         /// </summary>
1076         /// <since_tizen> 3 </since_tizen>
1077         public float Opacity
1078         {
1079             get
1080             {
1081                 return (float)GetValue(OpacityProperty);
1082             }
1083             set
1084             {
1085                 SetValue(OpacityProperty, value);
1086                 selectorData?.Opacity?.Reset(this);
1087                 NotifyPropertyChanged();
1088             }
1089         }
1090
1091         /// <summary>
1092         /// Sets the position of the view for X and Y.<br />
1093         /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1094         /// If the position inheritance is disabled, sets the world position.<br />
1095         /// </summary>
1096         /// <remarks>
1097         /// This NUI object (Position2D) typed property can be configured by multiple cascade setting. <br />
1098         /// For example, this code ( view.Position2D.X = 100; view.Position2D.Y = 100; ) is equivalent to this ( view.Position2D = new Position2D(100, 100); ). <br />
1099         /// </remarks>
1100         /// <since_tizen> 3 </since_tizen>
1101         public Position2D Position2D
1102         {
1103             get
1104             {
1105                 Position2D temp = (Position2D)GetValue(Position2DProperty);
1106                 return new Position2D(OnPosition2DChanged, temp.X, temp.Y);
1107             }
1108             set
1109             {
1110                 SetValue(Position2DProperty, value);
1111                 NotifyPropertyChanged();
1112             }
1113         }
1114
1115         /// <summary>
1116         /// Retrieves the screen position of the view.<br />
1117         /// </summary>
1118         /// <since_tizen> 3 </since_tizen>
1119         public Vector2 ScreenPosition
1120         {
1121             get
1122             {
1123                 Vector2 temp = new Vector2(0.0f, 0.0f);
1124                 var pValue = GetProperty(View.Property.ScreenPosition);
1125                 pValue.Get(temp);
1126                 pValue.Dispose();
1127                 return temp;
1128             }
1129         }
1130
1131         /// <summary>
1132         /// Determines whether the pivot point should be used to determine the position of the view.
1133         /// This is false by default.
1134         /// </summary>
1135         /// <remarks>If false, then the top-left of the view is used for the position.
1136         /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1137         /// </remarks>
1138         /// <since_tizen> 3 </since_tizen>
1139         public bool PositionUsesPivotPoint
1140         {
1141             get
1142             {
1143                 return (bool)GetValue(PositionUsesPivotPointProperty);
1144             }
1145             set
1146             {
1147                 SetValue(PositionUsesPivotPointProperty, value);
1148                 NotifyPropertyChanged();
1149             }
1150         }
1151
1152         /// <summary>
1153         /// Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead!
1154         /// </summary>
1155         /// <since_tizen> 3 </since_tizen>
1156         [Obsolete("Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead! " +
1157             "Like: " +
1158             "View view = new View(); " +
1159             "view.PivotPoint = PivotPoint.Center; " +
1160             "view.PositionUsesPivotPoint = true;" +
1161             " Deprecated in API5: Will be removed in API8")]
1162         [EditorBrowsable(EditorBrowsableState.Never)]
1163         public bool PositionUsesAnchorPoint
1164         {
1165             get
1166             {
1167                 bool temp = false;
1168                 var pValue = GetProperty(View.Property.PositionUsesAnchorPoint);
1169                 pValue.Get(out temp);
1170                 pValue.Dispose();
1171                 return temp;
1172             }
1173             set
1174             {
1175                 var temp = new Tizen.NUI.PropertyValue(value);
1176                 SetProperty(View.Property.PositionUsesAnchorPoint, temp);
1177                 temp.Dispose();
1178                 NotifyPropertyChanged();
1179             }
1180         }
1181
1182         /// <summary>
1183         /// Queries whether the view is connected to the stage.<br />
1184         /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1185         /// </summary>
1186         /// <since_tizen> 3 </since_tizen>
1187         public bool IsOnWindow
1188         {
1189             get
1190             {
1191                 return OnWindow();
1192             }
1193         }
1194
1195         /// <summary>
1196         /// Gets the depth in the hierarchy for the view.
1197         /// </summary>
1198         /// <since_tizen> 3 </since_tizen>
1199         public int HierarchyDepth
1200         {
1201             get
1202             {
1203                 return GetHierarchyDepth();
1204             }
1205         }
1206
1207         /// <summary>
1208         /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1209         /// </summary>
1210         /// <remarks>
1211         /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1212         /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1213         /// The values set by this property will likely change.
1214         /// </remarks>
1215         /// <since_tizen> 3 </since_tizen>
1216         public int SiblingOrder
1217         {
1218             get
1219             {
1220                 return (int)GetValue(SiblingOrderProperty);
1221             }
1222             set
1223             {
1224                 SetValue(SiblingOrderProperty, value);
1225
1226                 LayoutGroup layout = Layout as LayoutGroup;
1227                 layout?.ChangeLayoutSiblingOrder(value);
1228
1229                 NotifyPropertyChanged();
1230             }
1231         }
1232
1233         /// <summary>
1234         /// Returns the natural size of the view.
1235         /// </summary>
1236         /// <remarks>
1237         /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1238         /// </remarks>
1239         /// <since_tizen> 5 </since_tizen>
1240         public Vector3 NaturalSize
1241         {
1242             get
1243             {
1244                 Vector3 ret = new Vector3(Interop.Actor.GetNaturalSize(SwigCPtr), true);
1245                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1246                 return ret;
1247             }
1248         }
1249
1250         /// <summary>
1251         /// Returns the natural size (Size2D) of the view.
1252         /// </summary>
1253         /// <remarks>
1254         /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1255         /// </remarks>
1256         /// <since_tizen> 4 </since_tizen>
1257         public Size2D NaturalSize2D
1258         {
1259             get
1260             {
1261                 Vector3 temp = new Vector3(Interop.Actor.GetNaturalSize(SwigCPtr), true);
1262                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1263
1264                 Size2D sz = new Size2D((int)temp.Width, (int)temp.Height);
1265                 temp.Dispose();
1266                 return sz;
1267             }
1268         }
1269
1270         /// <summary>
1271         /// Gets or sets the origin of a view within its parent's area.<br />
1272         /// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the parent, and (1.0, 1.0, 0.5) is the bottom-right corner.<br />
1273         /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1274         /// A view's position is the distance between this origin and the view's anchor-point.<br />
1275         /// </summary>
1276         /// <pre>The view has been initialized.</pre>
1277         /// <since_tizen> 3 </since_tizen>
1278         public Position ParentOrigin
1279         {
1280             get
1281             {
1282                 Position tmp = (Position)GetValue(ParentOriginProperty);
1283                 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1284             }
1285             set
1286             {
1287                 SetValue(ParentOriginProperty, value);
1288                 NotifyPropertyChanged();
1289             }
1290         }
1291
1292         /// <summary>
1293         /// Gets or sets the anchor-point of a view.<br />
1294         /// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the view, and (1.0, 1.0, 0.5) is the bottom-right corner.<br />
1295         /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1296         /// A view position is the distance between its parent-origin and this anchor-point.<br />
1297         /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1298         /// <pre>The view has been initialized.</pre>
1299         /// </summary>
1300         /// <remarks>
1301         /// The property cascade chaining set is possible. For example, this (view.PivotPoint.X = 0.1f;) is possible.
1302         /// </remarks>
1303         /// <since_tizen> 3 </since_tizen>
1304         public Position PivotPoint
1305         {
1306             get
1307             {
1308                 Position tmp = (Position)GetValue(PivotPointProperty);
1309                 return new Position(OnPivotPointChanged, tmp.X, tmp.Y, tmp.Z);
1310             }
1311             set
1312             {
1313                 SetValue(PivotPointProperty, value);
1314                 NotifyPropertyChanged();
1315             }
1316         }
1317
1318         /// <summary>
1319         /// Gets or sets the size width of the view.
1320         /// </summary>
1321         /// <remarks>
1322         /// <para>
1323         /// Animatable - This property can be animated using <c>Animation</c> class.
1324         /// </para>
1325         /// </remarks>
1326         /// <since_tizen> 3 </since_tizen>
1327         public float SizeWidth
1328         {
1329             get
1330             {
1331                 return (float)GetValue(SizeWidthProperty);
1332             }
1333             set
1334             {
1335                 SetValue(SizeWidthProperty, value);
1336                 NotifyPropertyChanged();
1337             }
1338         }
1339
1340         /// <summary>
1341         /// Gets or sets the size height of the view.
1342         /// </summary>
1343         /// <remarks>
1344         /// <para>
1345         /// Animatable - This property can be animated using <c>Animation</c> class.
1346         /// </para>
1347         /// </remarks>
1348         /// <since_tizen> 3 </since_tizen>
1349         public float SizeHeight
1350         {
1351             get
1352             {
1353                 return (float)GetValue(SizeHeightProperty);
1354             }
1355             set
1356             {
1357                 SetValue(SizeHeightProperty, value);
1358                 NotifyPropertyChanged();
1359             }
1360         }
1361
1362         /// <summary>
1363         /// Gets or sets the position of the view.<br />
1364         /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1365         /// If the position inheritance is disabled, sets the world position.<br />
1366         /// </summary>
1367         /// <remarks>
1368         /// <para>
1369         /// Animatable - This property can be animated using <c>Animation</c> class.
1370         /// </para>
1371         /// The property cascade chaining set is possible. For example, this (view.Position.X = 1.0f;) is possible.
1372         /// </remarks>
1373         /// <since_tizen> 3 </since_tizen>
1374         public Position Position
1375         {
1376             get
1377             {
1378                 Position tmp = (Position)GetValue(PositionProperty);
1379                 return new Position(OnPositionChanged, tmp.X, tmp.Y, tmp.Z);
1380             }
1381             set
1382             {
1383                 SetValue(PositionProperty, value);
1384                 NotifyPropertyChanged();
1385             }
1386         }
1387
1388         /// <summary>
1389         /// Gets or sets the position X of the view.
1390         /// </summary>
1391         /// <remarks>
1392         /// <para>
1393         /// Animatable - This property can be animated using <c>Animation</c> class.
1394         /// </para>
1395         /// </remarks>
1396         /// <since_tizen> 3 </since_tizen>
1397         public float PositionX
1398         {
1399             get
1400             {
1401                 return (float)GetValue(PositionXProperty);
1402             }
1403             set
1404             {
1405                 SetValue(PositionXProperty, value);
1406                 NotifyPropertyChanged();
1407             }
1408         }
1409
1410         /// <summary>
1411         /// Gets or sets the position Y of the view.
1412         /// </summary>
1413         /// <remarks>
1414         /// <para>
1415         /// Animatable - This property can be animated using <c>Animation</c> class.
1416         /// </para>
1417         /// </remarks>
1418         /// <since_tizen> 3 </since_tizen>
1419         public float PositionY
1420         {
1421             get
1422             {
1423                 return (float)GetValue(PositionYProperty);
1424             }
1425             set
1426             {
1427                 SetValue(PositionYProperty, value);
1428                 NotifyPropertyChanged();
1429             }
1430         }
1431
1432         /// <summary>
1433         /// Gets or sets the position Z of the view.
1434         /// </summary>
1435         /// <remarks>
1436         /// <para>
1437         /// Animatable - This property can be animated using <c>Animation</c> class.
1438         /// </para>
1439         /// </remarks>
1440         /// <since_tizen> 3 </since_tizen>
1441         public float PositionZ
1442         {
1443             get
1444             {
1445                 return (float)GetValue(PositionZProperty);
1446             }
1447             set
1448             {
1449                 SetValue(PositionZProperty, value);
1450                 NotifyPropertyChanged();
1451             }
1452         }
1453
1454         /// <summary>
1455         /// Gets or sets the world position of the view.
1456         /// </summary>
1457         /// <since_tizen> 3 </since_tizen>
1458         public Vector3 WorldPosition
1459         {
1460             get
1461             {
1462                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1463                 var pValue = GetProperty(View.Property.WorldPosition);
1464                 pValue.Get(temp);
1465                 pValue.Dispose();
1466                 return temp;
1467             }
1468         }
1469
1470         /// <summary>
1471         /// Gets or sets the orientation of the view.<br />
1472         /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1473         /// </summary>
1474         /// <remarks>
1475         /// <para>
1476         /// This is an asynchronous method.
1477         /// </para>
1478         /// <para>
1479         /// Animatable - This property can be animated using <c>Animation</c> class.
1480         /// </para>
1481         /// </remarks>
1482         /// <since_tizen> 3 </since_tizen>
1483         public Rotation Orientation
1484         {
1485             get
1486             {
1487                 return (Rotation)GetValue(OrientationProperty);
1488             }
1489             set
1490             {
1491                 SetValue(OrientationProperty, value);
1492                 NotifyPropertyChanged();
1493             }
1494         }
1495
1496         /// <summary>
1497         /// Gets or sets the world orientation of the view.<br />
1498         /// </summary>
1499         /// <since_tizen> 3 </since_tizen>
1500         public Rotation WorldOrientation
1501         {
1502             get
1503             {
1504                 Rotation temp = new Rotation();
1505                 var pValue = GetProperty(View.Property.WorldOrientation);
1506                 pValue.Get(temp);
1507                 pValue.Dispose();
1508                 return temp;
1509             }
1510         }
1511
1512         /// <summary>
1513         /// Gets or sets the scale factor applied to the view.<br />
1514         /// </summary>
1515         /// <remarks>
1516         /// <para>
1517         /// Animatable - This property can be animated using <c>Animation</c> class.
1518         /// </para>
1519         /// The property cascade chaining set is possible. For example, this (view.Scale.X = 0.1f;) is possible.
1520         /// </remarks>
1521         /// <since_tizen> 3 </since_tizen>
1522         public Vector3 Scale
1523         {
1524             get
1525             {
1526                 Vector3 temp = (Vector3)GetValue(ScaleProperty);
1527                 return new Vector3(OnScaleChanged, temp.X, temp.Y, temp.Z);
1528             }
1529             set
1530             {
1531                 SetValue(ScaleProperty, value);
1532                 NotifyPropertyChanged();
1533             }
1534         }
1535
1536         /// <summary>
1537         /// Gets or sets the scale X factor applied to the view.
1538         /// </summary>
1539         /// <remarks>
1540         /// <para>
1541         /// Animatable - This property can be animated using <c>Animation</c> class.
1542         /// </para>
1543         /// </remarks>
1544         /// <since_tizen> 3 </since_tizen>
1545         public float ScaleX
1546         {
1547             get
1548             {
1549                 return (float)GetValue(ScaleXProperty);
1550             }
1551             set
1552             {
1553                 SetValue(ScaleXProperty, value);
1554                 NotifyPropertyChanged();
1555             }
1556         }
1557
1558         /// <summary>
1559         /// Gets or sets the scale Y factor applied to the view.
1560         /// </summary>
1561         /// <remarks>
1562         /// <para>
1563         /// Animatable - This property can be animated using <c>Animation</c> class.
1564         /// </para>
1565         /// </remarks>
1566         /// <since_tizen> 3 </since_tizen>
1567         public float ScaleY
1568         {
1569             get
1570             {
1571                 return (float)GetValue(ScaleYProperty);
1572             }
1573             set
1574             {
1575                 SetValue(ScaleYProperty, value);
1576                 NotifyPropertyChanged();
1577             }
1578         }
1579
1580         /// <summary>
1581         /// Gets or sets the scale Z factor applied to the view.
1582         /// </summary>
1583         /// <remarks>
1584         /// <para>
1585         /// Animatable - This property can be animated using <c>Animation</c> class.
1586         /// </para>
1587         /// </remarks>
1588         /// <since_tizen> 3 </since_tizen>
1589         public float ScaleZ
1590         {
1591             get
1592             {
1593                 return (float)GetValue(ScaleZProperty);
1594             }
1595             set
1596             {
1597                 SetValue(ScaleZProperty, value);
1598                 NotifyPropertyChanged();
1599             }
1600         }
1601
1602         /// <summary>
1603         /// Gets the world scale of the view.
1604         /// </summary>
1605         /// <since_tizen> 3 </since_tizen>
1606         public Vector3 WorldScale
1607         {
1608             get
1609             {
1610                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1611                 var pValue = GetProperty(View.Property.WorldScale);
1612                 pValue.Get(temp);
1613                 pValue.Dispose();
1614                 return temp;
1615             }
1616         }
1617
1618         /// <summary>
1619         /// Retrieves the visibility flag of the view.
1620         /// </summary>
1621         /// <remarks>
1622         /// <para>
1623         /// If the view is not visible, then the view and its children will not be rendered.
1624         /// This is regardless of the individual visibility values of the children, i.e., the view will only be rendered if all of its parents have visibility set to true.
1625         /// </para>
1626         /// <para>
1627         /// Animatable - This property can be animated using <c>Animation</c> class.
1628         /// </para>
1629         /// </remarks>
1630         /// <since_tizen> 3 </since_tizen>
1631         public bool Visibility
1632         {
1633             get
1634             {
1635                 bool temp = false;
1636                 var pValue = GetProperty(View.Property.VISIBLE);
1637                 pValue.Get(out temp);
1638                 pValue.Dispose();
1639                 return temp;
1640             }
1641         }
1642
1643         /// <summary>
1644         /// Gets the view's world color.
1645         /// </summary>
1646         /// <since_tizen> 3 </since_tizen>
1647         public Vector4 WorldColor
1648         {
1649             get
1650             {
1651                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
1652                 var pValue = GetProperty(View.Property.WorldColor);
1653                 pValue.Get(temp);
1654                 pValue.Dispose();
1655                 return temp;
1656             }
1657         }
1658
1659         /// <summary>
1660         /// Gets or sets the view's name.
1661         /// </summary>
1662         /// <since_tizen> 3 </since_tizen>
1663         public string Name
1664         {
1665             get
1666             {
1667                 return (string)GetValue(NameProperty);
1668             }
1669             set
1670             {
1671                 SetValue(NameProperty, value);
1672                 NotifyPropertyChanged();
1673             }
1674         }
1675
1676         /// <summary>
1677         /// Get the number of children held by the view.
1678         /// </summary>
1679         /// <since_tizen> 3 </since_tizen>
1680         public new uint ChildCount
1681         {
1682             get
1683             {
1684                 return Convert.ToUInt32(Children.Count);
1685             }
1686         }
1687
1688         /// <summary>
1689         /// Gets the view's ID.
1690         /// Read-only
1691         /// </summary>
1692         /// <since_tizen> 3 </since_tizen>
1693         public uint ID
1694         {
1695             get
1696             {
1697                 return GetId();
1698             }
1699         }
1700
1701         /// <summary>
1702         /// Gets or sets the status of whether the view should emit touch or hover signals.
1703         /// </summary>
1704         /// <since_tizen> 3 </since_tizen>
1705         public bool Sensitive
1706         {
1707             get
1708             {
1709                 return (bool)GetValue(SensitiveProperty);
1710             }
1711             set
1712             {
1713                 SetValue(SensitiveProperty, value);
1714                 NotifyPropertyChanged();
1715             }
1716         }
1717
1718         /// <summary>
1719         /// Gets or sets the status of whether the view should receive a notification when touch or hover motion events leave the boundary of the view.
1720         /// </summary>
1721         /// <since_tizen> 3 </since_tizen>
1722         public bool LeaveRequired
1723         {
1724             get
1725             {
1726                 return (bool)GetValue(LeaveRequiredProperty);
1727             }
1728             set
1729             {
1730                 SetValue(LeaveRequiredProperty, value);
1731                 NotifyPropertyChanged();
1732             }
1733         }
1734
1735         /// <summary>
1736         /// Gets or sets the status of whether a child view inherits it's parent's orientation.
1737         /// </summary>
1738         /// <since_tizen> 3 </since_tizen>
1739         public bool InheritOrientation
1740         {
1741             get
1742             {
1743                 return (bool)GetValue(InheritOrientationProperty);
1744             }
1745             set
1746             {
1747                 SetValue(InheritOrientationProperty, value);
1748                 NotifyPropertyChanged();
1749             }
1750         }
1751
1752         /// <summary>
1753         /// Gets or sets the status of whether a child view inherits it's parent's scale.
1754         /// </summary>
1755         /// <since_tizen> 3 </since_tizen>
1756         public bool InheritScale
1757         {
1758             get
1759             {
1760                 return (bool)GetValue(InheritScaleProperty);
1761             }
1762             set
1763             {
1764                 SetValue(InheritScaleProperty, value);
1765                 NotifyPropertyChanged();
1766             }
1767         }
1768
1769         /// <summary>
1770         /// Gets or sets the status of how the view and its children should be drawn.<br />
1771         /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
1772         /// If an object is in a 3D layer, it will be depth-tested against other objects in the world, i.e., it may be obscured if other objects are in front.<br />
1773         /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
1774         /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
1775         /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
1776         /// </summary>
1777         /// <since_tizen> 3 </since_tizen>
1778         public DrawModeType DrawMode
1779         {
1780             get
1781             {
1782                 return (DrawModeType)GetValue(DrawModeProperty);
1783             }
1784             set
1785             {
1786                 SetValue(DrawModeProperty, value);
1787                 NotifyPropertyChanged();
1788             }
1789         }
1790
1791         /// <summary>
1792         /// Gets or sets the relative to parent size factor of the view.<br />
1793         /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
1794         /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
1795         /// </summary>
1796         /// <remarks>
1797         /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
1798         /// </remarks>
1799         /// <since_tizen> 3 </since_tizen>
1800         public Vector3 SizeModeFactor
1801         {
1802             get
1803             {
1804                 Vector3 temp = (Vector3)GetValue(SizeModeFactorProperty);
1805                 return new Vector3(OnSizeModeFactorChanged, temp.X, temp.Y, temp.Z);
1806             }
1807             set
1808             {
1809                 SetValue(SizeModeFactorProperty, value);
1810                 NotifyPropertyChanged();
1811             }
1812         }
1813
1814         /// <summary>
1815         /// Gets or sets the width resize policy to be used.
1816         /// </summary>
1817         /// <since_tizen> 3 </since_tizen>
1818         public ResizePolicyType WidthResizePolicy
1819         {
1820             get
1821             {
1822                 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
1823             }
1824             set
1825             {
1826                 SetValue(WidthResizePolicyProperty, value);
1827                 NotifyPropertyChanged();
1828             }
1829         }
1830
1831         /// <summary>
1832         /// Gets or sets the height resize policy to be used.
1833         /// </summary>
1834         /// <since_tizen> 3 </since_tizen>
1835         public ResizePolicyType HeightResizePolicy
1836         {
1837             get
1838             {
1839                 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
1840             }
1841             set
1842             {
1843                 SetValue(HeightResizePolicyProperty, value);
1844                 NotifyPropertyChanged();
1845             }
1846         }
1847
1848         /// <summary>
1849         /// Gets or sets the policy to use when setting size with size negotiation.<br />
1850         /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
1851         /// </summary>
1852         /// <since_tizen> 3 </since_tizen>
1853         public SizeScalePolicyType SizeScalePolicy
1854         {
1855             get
1856             {
1857                 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
1858             }
1859             set
1860             {
1861                 SetValue(SizeScalePolicyProperty, value);
1862                 NotifyPropertyChanged();
1863             }
1864         }
1865
1866         /// <summary>
1867         ///  Gets or sets the status of whether the width size is dependent on the height size.
1868         /// </summary>
1869         /// <since_tizen> 3 </since_tizen>
1870         public bool WidthForHeight
1871         {
1872             get
1873             {
1874                 return (bool)GetValue(WidthForHeightProperty);
1875             }
1876             set
1877             {
1878                 SetValue(WidthForHeightProperty, value);
1879                 NotifyPropertyChanged();
1880             }
1881         }
1882
1883         /// <summary>
1884         /// Gets or sets the status of whether the height size is dependent on the width size.
1885         /// </summary>
1886         /// <since_tizen> 3 </since_tizen>
1887         public bool HeightForWidth
1888         {
1889             get
1890             {
1891                 return (bool)GetValue(HeightForWidthProperty);
1892             }
1893             set
1894             {
1895                 SetValue(HeightForWidthProperty, value);
1896                 NotifyPropertyChanged();
1897             }
1898         }
1899
1900         /// <summary>
1901         /// Gets or sets the padding for use in layout.
1902         /// </summary>
1903         /// <remarks>
1904         /// The property cascade chaining set is possible. For example, this (view.Padding.X = 0.1f;) is possible.
1905         /// </remarks>
1906         /// <since_tizen> 5 </since_tizen>
1907         public Extents Padding
1908         {
1909             get
1910             {
1911                 // If View has a Layout then padding in stored in the base Layout class
1912                 if (Layout != null)
1913                 {
1914                     return Layout.Padding;
1915                 }
1916                 else
1917                 {
1918                     Extents temp = (Extents)GetValue(PaddingProperty);
1919                     return new Extents(OnPaddingChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
1920                 }
1921                 // Two return points to prevent creating a zeroed Extent native object before assignment
1922             }
1923             set
1924             {
1925                 Extents padding = value;
1926                 if (Layout != null)
1927                 {
1928                     // Layout set so store Padding in LayoutItem instead of in View.
1929                     // If View stores the Padding value then Legacy Size Negotiation will overwrite
1930                     // the position and sizes measure in the Layouting.
1931                     Layout.Padding = value;
1932                     // If Layout is a LayoutItem then it could be a View that handles it's own padding.
1933                     // Let the View keeps it's padding.  Still store Padding in Layout to reduce code paths.
1934                     if (typeof(LayoutGroup).IsAssignableFrom(Layout.GetType())) // If a Layout container of some kind.
1935                     {
1936                         padding = new Extents(0, 0, 0, 0); // Reset value stored in View.
1937                     }
1938                 }
1939
1940                 SetValue(PaddingProperty, padding);
1941                 NotifyPropertyChanged();
1942             }
1943         }
1944
1945         /// <summary>
1946         /// Gets or sets the minimum size the view can be assigned in size negotiation.
1947         /// </summary>
1948         /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
1949         /// <remarks>
1950         /// The property cascade chaining set is possible. For example, this (view.MinimumSize.Width = 1;) is possible.
1951         /// </remarks>
1952         /// <since_tizen> 3 </since_tizen>
1953         public Size2D MinimumSize
1954         {
1955             get
1956             {
1957                 Size2D tmp = (Size2D)GetValue(MinimumSizeProperty);
1958                 return new Size2D(OnMinimumSizeChanged, tmp.Width, tmp.Height);
1959             }
1960             set
1961             {
1962                 if (value == null)
1963                 {
1964                     throw new ArgumentNullException(nameof(value));
1965                 }
1966                 if (layout != null)
1967                 {
1968                     // Note: it only works if minimum size is >= than natural size.
1969                     // To force the size it should be done through the width&height spec or Size2D.
1970                     layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
1971                     layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
1972                     layout.RequestLayout();
1973                 }
1974                 SetValue(MinimumSizeProperty, value);
1975                 NotifyPropertyChanged();
1976             }
1977         }
1978
1979         /// <summary>
1980         /// Gets or sets the maximum size the view can be assigned in size negotiation.
1981         /// </summary>
1982         /// <remarks>
1983         /// The property cascade chaining set is possible. For example, this (view.MaximumSize.Width = 1;) is possible.
1984         /// </remarks>
1985         /// <since_tizen> 3 </since_tizen>
1986         public Size2D MaximumSize
1987         {
1988             get
1989             {
1990                 Size2D tmp = (Size2D)GetValue(MaximumSizeProperty);
1991                 return new Size2D(OnMaximumSizeChanged, tmp.Width, tmp.Height);
1992             }
1993             set
1994             {
1995                 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
1996                 // MATCH_PARENT spec + parent container size can be used to limit
1997                 if (layout != null)
1998                 {
1999                     layout.RequestLayout();
2000                 }
2001                 SetValue(MaximumSizeProperty, value);
2002                 NotifyPropertyChanged();
2003             }
2004         }
2005
2006         /// <summary>
2007         /// Gets or sets whether a child view inherits it's parent's position.<br />
2008         /// Default is to inherit.<br />
2009         /// Switching this off means that using position sets the view's world position, i.e., translates from the world origin (0,0,0) to the pivot point of the view.<br />
2010         /// </summary>
2011         /// <since_tizen> 3 </since_tizen>
2012         public bool InheritPosition
2013         {
2014             get
2015             {
2016                 return (bool)GetValue(InheritPositionProperty);
2017             }
2018             set
2019             {
2020                 SetValue(InheritPositionProperty, value);
2021                 NotifyPropertyChanged();
2022             }
2023         }
2024
2025         /// <summary>
2026         /// Gets or sets the clipping behavior (mode) of it's children.
2027         /// </summary>
2028         /// <since_tizen> 3 </since_tizen>
2029         public ClippingModeType ClippingMode
2030         {
2031             get
2032             {
2033                 return (ClippingModeType)GetValue(ClippingModeProperty);
2034             }
2035             set
2036             {
2037                 SetValue(ClippingModeProperty, value);
2038                 NotifyPropertyChanged();
2039             }
2040         }
2041
2042         /// <summary>
2043         /// Gets the number of renderers held by the view.
2044         /// </summary>
2045         /// <since_tizen> 3 </since_tizen>
2046         public uint RendererCount
2047         {
2048             get
2049             {
2050                 return GetRendererCount();
2051             }
2052         }
2053
2054         /// <summary>
2055         /// Deprecated in API5; Will be removed in API8. Please use PivotPoint instead!
2056         /// </summary>
2057         /// <remarks>
2058         /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2059         /// </remarks>
2060         /// <since_tizen> 3 </since_tizen>
2061         [Obsolete("Deprecated in API5; Will be removed in API8. Please use PivotPoint instead! " +
2062             "Like: " +
2063             "View view = new View(); " +
2064             "view.PivotPoint = PivotPoint.Center; " +
2065             "view.PositionUsesPivotPoint = true;")]
2066         [EditorBrowsable(EditorBrowsableState.Never)]
2067         public Position AnchorPoint
2068         {
2069             get
2070             {
2071                 Position temp = new Position(0.0f, 0.0f, 0.0f);
2072                 var pValue = GetProperty(View.Property.AnchorPoint);
2073                 pValue.Get(temp);
2074                 pValue.Dispose();
2075                 Position ret = new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
2076                 temp.Dispose();
2077                 return ret;
2078             }
2079             set
2080             {
2081                 var temp = new Tizen.NUI.PropertyValue(value);
2082                 SetProperty(View.Property.AnchorPoint, temp);
2083                 temp.Dispose();
2084                 NotifyPropertyChanged();
2085             }
2086         }
2087
2088         /// <summary>
2089         /// Sets the size of a view for the width, the height and the depth.<br />
2090         /// Geometry can be scaled to fit within this area.<br />
2091         /// This does not interfere with the view's scale factor.<br />
2092         /// The views default depth is the minimum of width and height.<br />
2093         /// </summary>
2094         /// <remarks>
2095         /// <para>
2096         /// Animatable - This property can be animated using <c>Animation</c> class.
2097         /// </para>
2098         /// The property cascade chaining set is possible. For example, this (view.Size.Width = 1.0f;) is possible.
2099         /// </remarks>
2100         /// <since_tizen> 5 </since_tizen>
2101         public Size Size
2102         {
2103             get
2104             {
2105                 Size tmp = (Size)GetValue(SizeProperty);
2106                 return new Size(OnSizeChanged, tmp.Width, tmp.Height, tmp.Depth);
2107             }
2108             set
2109             {
2110                 SetValue(SizeProperty, value);
2111                 NotifyPropertyChanged();
2112             }
2113         }
2114
2115         /// <summary>
2116         /// Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead!
2117         /// </summary>
2118         /// <since_tizen> 3 </since_tizen>
2119         [Obsolete("Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead! " +
2120             "Like: " +
2121             "Container parent =  view.GetParent(); " +
2122             "View view = parent as View;")]
2123         [EditorBrowsable(EditorBrowsableState.Never)]
2124         public new View Parent
2125         {
2126             get
2127             {
2128                 View ret;
2129                 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2130                 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2131                 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2132
2133                 if (basehandle is Layer layer)
2134                 {
2135                     ret = new View(Layer.getCPtr(layer).Handle, false);
2136                     NUILog.Error("This Parent property is deprecated, should do not be used");
2137                 }
2138                 else
2139                 {
2140                     ret = basehandle as View;
2141                 }
2142
2143                 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2144                 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2145
2146                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2147                 return ret;
2148             }
2149         }
2150
2151         /// <summary>
2152         /// Gets/Sets whether inherit parent's the layout Direction.
2153         /// </summary>
2154         /// <since_tizen> 4 </since_tizen>
2155         public bool InheritLayoutDirection
2156         {
2157             get
2158             {
2159                 return (bool)GetValue(InheritLayoutDirectionProperty);
2160             }
2161             set
2162             {
2163                 SetValue(InheritLayoutDirectionProperty, value);
2164                 NotifyPropertyChanged();
2165             }
2166         }
2167
2168         /// <summary>
2169         /// Gets/Sets the layout Direction.
2170         /// </summary>
2171         /// <since_tizen> 4 </since_tizen>
2172         public ViewLayoutDirectionType LayoutDirection
2173         {
2174             get
2175             {
2176                 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2177             }
2178             set
2179             {
2180                 SetValue(LayoutDirectionProperty, value);
2181                 NotifyPropertyChanged();
2182                 layout?.RequestLayout();
2183             }
2184         }
2185
2186         /// <summary>
2187         /// Gets or sets the Margin for use in layout.
2188         /// </summary>
2189         /// <remarks>
2190         /// Margin property is supported by Layout algorithms and containers.
2191         /// Please Set Layout if you want to use Margin property.
2192         /// The property cascade chaining set is possible. For example, this (view.Margin.X = 0.1f;) is possible.
2193         /// </remarks>
2194         /// <since_tizen> 4 </since_tizen>
2195         public Extents Margin
2196         {
2197             get
2198             {
2199                 // If View has a Layout then margin is stored in Layout.
2200                 if (Layout != null)
2201                 {
2202                     return Layout.Margin;
2203                 }
2204                 else
2205                 {
2206                     // If Layout not set then return margin stored in View.
2207                     Extents temp = (Extents)GetValue(MarginProperty);
2208                     return new Extents(OnMarginChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2209                 }
2210                 // Two return points to prevent creating a zeroed Extent native object before assignment
2211             }
2212             set
2213             {
2214                 if (Layout != null)
2215                 {
2216                     // Layout set so store Margin in LayoutItem instead of View.
2217                     // If View stores the Margin too then the Legacy Size Negotiation will
2218                     // overwrite the position and size values measured in the Layouting.
2219                     Layout.Margin = value;
2220                     SetValue(MarginProperty, new Extents(0, 0, 0, 0));
2221                     layout?.RequestLayout();
2222                 }
2223                 else
2224                 {
2225                     SetValue(MarginProperty, value);
2226                 }
2227                 NotifyPropertyChanged();
2228                 layout?.RequestLayout();
2229             }
2230         }
2231
2232         ///<summary>
2233         /// The required policy for this dimension, LayoutParamPolicies enum or exact value.
2234         ///</summary>
2235         /// <since_tizen> 6 </since_tizen>
2236         public int WidthSpecification
2237         {
2238             get
2239             {
2240                 return widthPolicy;
2241             }
2242             set
2243             {
2244                 if (value == widthPolicy)
2245                     return;
2246
2247                 widthPolicy = value;
2248                 if (widthPolicy >= 0)
2249                 {
2250                     if (heightPolicy >= 0) // Policy an exact value
2251                     {
2252                         // Create Size2D only both _widthPolicy and _heightPolicy are set.
2253                         Size2D = new Size2D(widthPolicy, heightPolicy);
2254                     }
2255                 }
2256                 layout?.RequestLayout();
2257             }
2258         }
2259
2260         ///<summary>
2261         /// The required policy for this dimension, LayoutParamPolicies enum or exact value.
2262         ///</summary>
2263         /// <since_tizen> 6 </since_tizen>
2264         public int HeightSpecification
2265         {
2266             get
2267             {
2268                 return heightPolicy;
2269             }
2270             set
2271             {
2272                 if (value == heightPolicy)
2273                     return;
2274
2275                 heightPolicy = value;
2276                 if (heightPolicy >= 0)
2277                 {
2278                     if (widthPolicy >= 0) // Policy an exact value
2279                     {
2280                         // Create Size2D only both _widthPolicy and _heightPolicy are set.
2281                         Size2D = new Size2D(widthPolicy, heightPolicy);
2282                     }
2283                 }
2284                 layout?.RequestLayout();
2285             }
2286         }
2287
2288         ///<summary>
2289         /// Gets the List of transitions for this View.
2290         ///</summary>
2291         /// <since_tizen> 6 </since_tizen>
2292         public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2293         {
2294             get
2295             {
2296                 if (layoutTransitions == null)
2297                 {
2298                     layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2299                 }
2300                 return layoutTransitions;
2301             }
2302         }
2303
2304         ///<summary>
2305         /// Set a layout transitions for this View.
2306         ///</summary>
2307         /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2308         /// <remarks>
2309         /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2310         /// </remarks>
2311         /// <since_tizen> 6 </since_tizen>
2312         public LayoutTransition LayoutTransition
2313         {
2314             get
2315             {
2316                 return layoutTransition;
2317             }
2318             set
2319             {
2320                 if (value == null)
2321                 {
2322                     throw new global::System.ArgumentNullException(nameof(value));
2323                 }
2324                 if (layoutTransitions == null)
2325                 {
2326                     layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2327                 }
2328
2329                 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
2330
2331                 AttachTransitionsToChildren(value);
2332
2333                 layoutTransition = value;
2334             }
2335         }
2336
2337         /// <summary>
2338         /// Deprecated in API5; Will be removed in API8. Please use Padding instead.
2339         /// </summary>
2340         /// <remarks>
2341         /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2342         /// </remarks>
2343         /// <since_tizen> 4 </since_tizen>
2344         [Obsolete("Deprecated in API5; Will be removed in API8. Please use Padding instead.")]
2345         [EditorBrowsable(EditorBrowsableState.Never)]
2346         public Extents PaddingEX
2347         {
2348             get
2349             {
2350                 Extents temp = new Extents(0, 0, 0, 0);
2351                 var pValue = GetProperty(View.Property.PADDING);
2352                 pValue.Get(temp);
2353                 pValue.Dispose();
2354                 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2355                 temp.Dispose();
2356                 return ret;
2357             }
2358             set
2359             {
2360                 var temp = new Tizen.NUI.PropertyValue(value);
2361                 SetProperty(View.Property.PADDING, temp);
2362                 temp.Dispose();
2363                 NotifyPropertyChanged();
2364                 layout?.RequestLayout();
2365             }
2366         }
2367
2368         /// <summary>
2369         /// The Color of View. This is an RGBA value.
2370         /// </summary>
2371         /// <remarks>
2372         /// <para>
2373         /// Animatable - This property can be animated using <c>Animation</c> class.
2374         /// </para>
2375         /// The property cascade chaining set is possible. For example, this (view.Color.X = 0.1f;) is possible.
2376         /// </remarks>
2377         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2378         [EditorBrowsable(EditorBrowsableState.Never)]
2379         public Color Color
2380         {
2381             get
2382             {
2383                 Color temp = (Color)GetValue(ColorProperty);
2384                 return new Color(OnColorChanged, temp.R, temp.G, temp.B, temp.A);
2385             }
2386             set
2387             {
2388                 SetValue(ColorProperty, value);
2389                 selectorData?.Color?.Reset(this);
2390                 NotifyPropertyChanged();
2391             }
2392         }
2393
2394         /// <summary>
2395         /// Set the layout on this View. Replaces any existing Layout.
2396         /// </summary>
2397         /// <since_tizen> 6 </since_tizen>
2398         public LayoutItem Layout
2399         {
2400             get
2401             {
2402                 return layout;
2403             }
2404             set
2405             {
2406                 // Do nothing if layout provided is already set on this View.
2407                 if (value == layout)
2408                 {
2409                     return;
2410                 }
2411
2412                 LayoutingDisabled = false;
2413                 layoutSet = true;
2414
2415                 // If new layout being set already has a owner then that owner receives a replacement default layout.
2416                 // First check if the layout to be set already has a owner.
2417                 if (value?.Owner != null)
2418                 {
2419                     // Previous owner of the layout gets a default layout as a replacement.
2420                     value.Owner.Layout = new AbsoluteLayout();
2421
2422                     // Copy Margin and Padding to replacement LayoutGroup.
2423                     if (value.Owner.Layout != null)
2424                     {
2425                         value.Owner.Layout.Margin = value.Margin;
2426                         value.Owner.Layout.Padding = value.Padding;
2427                     }
2428                 }
2429
2430                 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2431                 // View if no replacement. Previously margin and padding values would have been moved from
2432                 // the View to the layout.
2433                 if (layout != null) // Existing layout
2434                 {
2435                     if (value != null)
2436                     {
2437                         // Existing layout being replaced so copy over margin and padding values.
2438                         value.Margin = layout.Margin;
2439                         value.Padding = layout.Padding;
2440                     }
2441                     else
2442                     {
2443                         // Layout not being replaced so restore margin and padding to View.
2444                         SetValue(MarginProperty, layout.Margin);
2445                         SetValue(PaddingProperty, layout.Padding);
2446                         NotifyPropertyChanged();
2447                     }
2448                 }
2449                 else
2450                 {
2451                     // First Layout to be added to the View hence copy
2452
2453                     // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2454                     if (value != null)
2455                     {
2456                         if (Margin.Top != 0 || Margin.Bottom != 0 || Margin.Start != 0 || Margin.End != 0)
2457                         {
2458                             // If View already has a margin set then store it in Layout instead.
2459                             value.Margin = Margin;
2460                             SetValue(MarginProperty, new Extents(0, 0, 0, 0));
2461                             NotifyPropertyChanged();
2462                         }
2463
2464                         if (Padding.Top != 0 || Padding.Bottom != 0 || Padding.Start != 0 || Padding.End != 0)
2465                         {
2466                             // If View already has a padding set then store it in Layout instead.
2467                             value.Padding = Padding;
2468
2469                             // If Layout is a LayoutItem then it could be a View that handles it's own padding.
2470                             // Let the View keeps it's padding.  Still store Padding in Layout to reduce code paths.
2471                             if (typeof(LayoutGroup).IsAssignableFrom(Layout.GetType()))
2472                             {
2473                                 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
2474                                 NotifyPropertyChanged();
2475                             }
2476                         }
2477                     }
2478                 }
2479
2480                 // Remove existing layout from it's parent layout group.
2481                 layout?.Unparent();
2482
2483                 value.SetPositionByLayout = !excludeLayouting;
2484
2485                 // Set layout to this view
2486                 SetLayout(value);
2487             }
2488         }
2489
2490         /// <summary>
2491         /// The weight of the View, used to share available space in a layout with siblings.
2492         /// </summary>
2493         /// <since_tizen> 6 </since_tizen>
2494         public float Weight
2495         {
2496             get
2497             {
2498                 return weight;
2499             }
2500             set
2501             {
2502                 weight = value;
2503                 layout?.RequestLayout();
2504             }
2505         }
2506
2507         /// <summary>
2508         ///  Whether to load the BackgroundImage synchronously.
2509         ///  If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
2510         ///  Note: For Normal Quad images only.
2511         /// </summary>
2512         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2513         [EditorBrowsable(EditorBrowsableState.Never)]
2514         public bool BackgroundImageSynchronosLoading
2515         {
2516             get
2517             {
2518                 return backgroundImageSynchronosLoading;
2519             }
2520             set
2521             {
2522                 backgroundImageSynchronosLoading = value;
2523
2524                 string bgUrl = null;
2525                 var pValue = Background.Find(ImageVisualProperty.URL);
2526                 pValue?.Get(out bgUrl);
2527                 pValue?.Dispose();
2528
2529                 if (!string.IsNullOrEmpty(bgUrl))
2530                 {
2531                     PropertyMap bgMap = this.Background;
2532                     var temp = new PropertyValue(backgroundImageSynchronosLoading);
2533                     bgMap.Add("synchronousLoading", temp);
2534                     temp.Dispose();
2535                     Background = bgMap;
2536                 }
2537             }
2538         }
2539
2540         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2541         [EditorBrowsable(EditorBrowsableState.Never)]
2542         public Vector2 UpdateSizeHint
2543         {
2544             get
2545             {
2546                 return (Vector2)GetValue(UpdateSizeHintProperty);
2547             }
2548             set
2549             {
2550                 SetValue(UpdateSizeHintProperty, value);
2551                 NotifyPropertyChanged();
2552             }
2553         }
2554
2555         /// <summary>
2556         /// Enable/Disable ControlState propagation for children.
2557         /// It is false by default.
2558         /// If the View needs to share ControlState with descendants, please set it true.
2559         /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
2560         /// </summary>
2561         [EditorBrowsable(EditorBrowsableState.Never)]
2562         public bool EnableControlStatePropagation
2563         {
2564             get => controlStatePropagation;
2565             set
2566             {
2567                 controlStatePropagation = value;
2568
2569                 foreach (View child in Children)
2570                 {
2571                     child.EnableControlStatePropagation = value;
2572                 }
2573             }
2574         }
2575
2576         /// <summary>
2577         /// By default, it is false in View, true in Control.
2578         /// Note that if the value is true, the View will be a touch receptor.
2579         /// </summary>
2580         [EditorBrowsable(EditorBrowsableState.Never)]
2581         public bool EnableControlState
2582         {
2583             get
2584             {
2585                 return (bool)GetValue(EnableControlStateProperty);
2586             }
2587             set
2588             {
2589                 SetValue(EnableControlStateProperty, value);
2590             }
2591         }
2592
2593         /// <summary>
2594         /// Whether the actor grab all touches even if touch leaves its boundary.
2595         /// </summary>
2596         /// <returns>true, if it grab all touch after start</returns>
2597         [EditorBrowsable(EditorBrowsableState.Never)]
2598         public bool GrabTouchAfterLeave
2599         {
2600             get
2601             {
2602                 bool temp = false;
2603                 var pValue = GetProperty(View.Property.CaptureAllTouchAfterStart);
2604                 pValue.Get(out temp);
2605                 pValue.Dispose();
2606                 return temp;
2607             }
2608             set
2609             {
2610                 var temp = new Tizen.NUI.PropertyValue(value);
2611                 SetProperty(View.Property.CaptureAllTouchAfterStart, temp);
2612                 temp.Dispose();
2613                 NotifyPropertyChanged();
2614             }
2615         }
2616
2617         /// <summary>
2618         /// Determines which blend equation will be used to render renderers of this actor.
2619         /// </summary>
2620         /// <returns>blend equation enum currently assigned</returns>
2621         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
2622         [EditorBrowsable(EditorBrowsableState.Never)]
2623         public BlendEquationType BlendEquation
2624         {
2625             get
2626             {
2627                 int temp = 0;
2628                 var pValue = GetProperty(View.Property.BlendEquation);
2629                 pValue.Get(out temp);
2630                 pValue.Dispose();
2631                 return (BlendEquationType)temp;
2632             }
2633             set
2634             {
2635                 var temp = new Tizen.NUI.PropertyValue((int)value);
2636                 SetProperty(View.Property.BlendEquation, temp);
2637                 temp.Dispose();
2638                 NotifyPropertyChanged();
2639             }
2640         }
2641
2642         /// <summary>
2643         /// If the value is true, the View will change its style as the theme changes.
2644         /// It is false by default, but turned to true when setting StyleName (by setting property or using specified constructor).
2645         /// </summary>
2646         [EditorBrowsable(EditorBrowsableState.Never)]
2647         public bool ThemeChangeSensitive
2648         {
2649             get => (bool)GetValue(ThemeChangeSensitiveProperty);
2650             set => SetValue(ThemeChangeSensitiveProperty, value);
2651         }
2652
2653         /// <summary>
2654         /// Create Style, it is abstract function and must be override.
2655         /// </summary>
2656         [EditorBrowsable(EditorBrowsableState.Never)]
2657         protected virtual ViewStyle CreateViewStyle()
2658         {
2659             return new ViewStyle();
2660         }
2661
2662         /// <summary>
2663         /// Called after the View's ControlStates changed.
2664         /// </summary>
2665         /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
2666         [EditorBrowsable(EditorBrowsableState.Never)]
2667         protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
2668         {
2669         }
2670
2671         /// <summary>
2672         /// </summary>
2673         [EditorBrowsable(EditorBrowsableState.Never)]
2674         protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
2675         {
2676             UpdateStyle();
2677         }
2678
2679         private bool IsViewPropertyDirty(BindableProperty styleProperty)
2680         {
2681             if (dirtyPropertySet.Count == 0)
2682             {
2683                 return false;
2684             }
2685
2686             if (styleProperty.ReturnType.IsGenericType && styleProperty.ReturnType.GetGenericTypeDefinition() == typeof(Selector<>))
2687             {
2688                 return dirtyPropertySet.Contains(styleProperty.PropertyName.Substring(0, styleProperty.PropertyName.Length - 8));
2689             }
2690
2691             return dirtyPropertySet.Contains(styleProperty.PropertyName);
2692         }
2693
2694         /// <summary>
2695         /// Apply style instance to the view.
2696         /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
2697         /// </summary>
2698         [EditorBrowsable(EditorBrowsableState.Never)]
2699         public virtual void ApplyStyle(ViewStyle viewStyle)
2700         {
2701             if (viewStyle == null || this.viewStyle == viewStyle) return;
2702
2703             this.viewStyle = viewStyle;
2704
2705             if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
2706             {
2707                 // Nothing to apply
2708                 return;
2709             }
2710
2711             if (dirtyPropertySet == null)
2712             {
2713                 dirtyPropertySet = new HashSet<string>();
2714             }
2715
2716             BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
2717
2718             if (bindablePropertyOfView == null)
2719             {
2720                 return;
2721             }
2722
2723             var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
2724             viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
2725
2726             foreach (var sourceProperty in dirtyStyleProperties)
2727             {
2728                 if (blockSetDirty && IsViewPropertyDirty(sourceProperty))
2729                 {
2730                     // Skip applying theme style for a property set by user.
2731                     continue;
2732                 }
2733
2734                 var sourceValue = viewStyle.GetValue(sourceProperty);
2735
2736                 if (sourceValue == null)
2737                 {
2738                     continue;
2739                 }
2740
2741                 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
2742
2743                 if (destinationProperty != null)
2744                 {
2745                     SetValue(destinationProperty, sourceValue);
2746                 }
2747             }
2748         }
2749
2750         /// <summary>
2751         /// Get whether the View is culled or not.
2752         /// True means that the View is out of the view frustum.
2753         /// </summary>
2754         /// <remarks>
2755         /// Hidden-API (Inhouse-API).
2756         /// </remarks>
2757         [EditorBrowsable(EditorBrowsableState.Never)]
2758         public bool Culled
2759         {
2760             get
2761             {
2762                 bool temp = false;
2763                 var pValue = GetProperty(View.Property.Culled);
2764                 pValue.Get(out temp);
2765                 pValue.Dispose();
2766                 return temp;
2767             }
2768         }
2769
2770     }
2771 }