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