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