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