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