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