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