[NUI] Apply CornerRadius to View (#1463)
[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                 NotifyPropertyChanged();
885             }
886         }
887
888         /// <summary>
889         /// Returns the natural size of the view.
890         /// </summary>
891         /// <remarks>
892         /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
893         /// </remarks>
894         /// <since_tizen> 5 </since_tizen>
895         public Vector3 NaturalSize
896         {
897             get
898             {
899                 Vector3 ret = new Vector3(Interop.Actor.Actor_GetNaturalSize(swigCPtr), true);
900                 if (NDalicPINVOKE.SWIGPendingException.Pending)
901                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
902                 return ret;
903             }
904         }
905
906         /// <summary>
907         /// Returns the natural size (Size2D) of the view.
908         /// </summary>
909         /// <remarks>
910         /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
911         /// </remarks>
912         /// <since_tizen> 4 </since_tizen>
913         public Size2D NaturalSize2D
914         {
915             get
916             {
917                 Vector3 temp = new Vector3(Interop.Actor.Actor_GetNaturalSize(swigCPtr), true);
918                 if (NDalicPINVOKE.SWIGPendingException.Pending)
919                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
920
921                 return new Size2D((int)temp.Width, (int)temp.Height);
922             }
923         }
924
925         /// <summary>
926         /// Gets or sets the origin of a view within its parent's area.<br />
927         /// 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 />
928         /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
929         /// A view's position is the distance between this origin and the view's anchor-point.<br />
930         /// </summary>
931         /// <pre>The view has been initialized.</pre>
932         /// <since_tizen> 3 </since_tizen>
933         public Position ParentOrigin
934         {
935             get
936             {
937                 Position tmp = (Position)GetValue(ParentOriginProperty);
938                 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
939             }
940             set
941             {
942                 SetValue(ParentOriginProperty, value);
943                 NotifyPropertyChanged();
944             }
945         }
946
947         /// <summary>
948         /// Gets or sets the anchor-point of a view.<br />
949         /// 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 />
950         /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
951         /// A view position is the distance between its parent-origin and this anchor-point.<br />
952         /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
953         /// <pre>The view has been initialized.</pre>
954         /// </summary>
955         /// <remarks>
956         /// The property cascade chaining set is possible. For example, this (view.PivotPoint.X = 0.1f;) is possible.
957         /// </remarks>
958         /// <since_tizen> 3 </since_tizen>
959         public Position PivotPoint
960         {
961             get
962             {
963                 Position tmp = (Position)GetValue(PivotPointProperty);
964                 return new Position(OnPivotPointChanged, tmp.X, tmp.Y, tmp.Z);
965             }
966             set
967             {
968                 SetValue(PivotPointProperty, value);
969                 NotifyPropertyChanged();
970             }
971         }
972
973         /// <summary>
974         /// Gets or sets the size width of the view.
975         /// </summary>
976         /// <remarks>
977         /// <para>
978         /// Animatable - This property can be animated using <c>Animation</c> class.
979         /// </para>
980         /// </remarks>
981         /// <since_tizen> 3 </since_tizen>
982         public float SizeWidth
983         {
984             get
985             {
986                 return (float)GetValue(SizeWidthProperty);
987             }
988             set
989             {
990                 SetValue(SizeWidthProperty, value);
991                 WidthSpecification = (int)Math.Ceiling(value);
992                 NotifyPropertyChanged();
993             }
994         }
995
996         /// <summary>
997         /// Gets or sets the size height of the view.
998         /// </summary>
999         /// <remarks>
1000         /// <para>
1001         /// Animatable - This property can be animated using <c>Animation</c> class.
1002         /// </para>
1003         /// </remarks>
1004         /// <since_tizen> 3 </since_tizen>
1005         public float SizeHeight
1006         {
1007             get
1008             {
1009                 return (float)GetValue(SizeHeightProperty);
1010             }
1011             set
1012             {
1013                 SetValue(SizeHeightProperty, value);
1014                 HeightSpecification = (int)Math.Ceiling(value);
1015                 NotifyPropertyChanged();
1016             }
1017         }
1018
1019         /// <summary>
1020         /// Gets or sets the position of the view.<br />
1021         /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1022         /// If the position inheritance is disabled, sets the world position.<br />
1023         /// </summary>
1024         /// <remarks>
1025         /// <para>
1026         /// Animatable - This property can be animated using <c>Animation</c> class.
1027         /// </para>
1028         /// The property cascade chaining set is possible. For example, this (view.Position.X = 1.0f;) is possible.
1029         /// </remarks>
1030         /// <since_tizen> 3 </since_tizen>
1031         public Position Position
1032         {
1033             get
1034             {
1035                 Position tmp = (Position)GetValue(PositionProperty);
1036                 return new Position(OnPositionChanged, tmp.X, tmp.Y, tmp.Z);
1037             }
1038             set
1039             {
1040                 SetValue(PositionProperty, value);
1041                 NotifyPropertyChanged();
1042             }
1043         }
1044
1045         /// <summary>
1046         /// Gets or sets the position X of the view.
1047         /// </summary>
1048         /// <remarks>
1049         /// <para>
1050         /// Animatable - This property can be animated using <c>Animation</c> class.
1051         /// </para>
1052         /// </remarks>
1053         /// <since_tizen> 3 </since_tizen>
1054         public float PositionX
1055         {
1056             get
1057             {
1058                 return (float)GetValue(PositionXProperty);
1059             }
1060             set
1061             {
1062                 SetValue(PositionXProperty, value);
1063                 NotifyPropertyChanged();
1064             }
1065         }
1066
1067         /// <summary>
1068         /// Gets or sets the position Y of the view.
1069         /// </summary>
1070         /// <remarks>
1071         /// <para>
1072         /// Animatable - This property can be animated using <c>Animation</c> class.
1073         /// </para>
1074         /// </remarks>
1075         /// <since_tizen> 3 </since_tizen>
1076         public float PositionY
1077         {
1078             get
1079             {
1080                 return (float)GetValue(PositionYProperty);
1081             }
1082             set
1083             {
1084                 SetValue(PositionYProperty, value);
1085                 NotifyPropertyChanged();
1086             }
1087         }
1088
1089         /// <summary>
1090         /// Gets or sets the position Z of the view.
1091         /// </summary>
1092         /// <remarks>
1093         /// <para>
1094         /// Animatable - This property can be animated using <c>Animation</c> class.
1095         /// </para>
1096         /// </remarks>
1097         /// <since_tizen> 3 </since_tizen>
1098         public float PositionZ
1099         {
1100             get
1101             {
1102                 return (float)GetValue(PositionZProperty);
1103             }
1104             set
1105             {
1106                 SetValue(PositionZProperty, value);
1107                 NotifyPropertyChanged();
1108             }
1109         }
1110
1111         /// <summary>
1112         /// Gets or sets the world position of the view.
1113         /// </summary>
1114         /// <since_tizen> 3 </since_tizen>
1115         public Vector3 WorldPosition
1116         {
1117             get
1118             {
1119                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1120                 GetProperty(View.Property.WORLD_POSITION).Get(temp);
1121                 return temp;
1122             }
1123         }
1124
1125         /// <summary>
1126         /// Gets or sets the orientation of the view.<br />
1127         /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1128         /// </summary>
1129         /// <remarks>
1130         /// <para>
1131         /// This is an asynchronous method.
1132         /// </para>
1133         /// <para>
1134         /// Animatable - This property can be animated using <c>Animation</c> class.
1135         /// </para>
1136         /// </remarks>
1137         /// <since_tizen> 3 </since_tizen>
1138         public Rotation Orientation
1139         {
1140             get
1141             {
1142                 return (Rotation)GetValue(OrientationProperty);
1143             }
1144             set
1145             {
1146                 SetValue(OrientationProperty, value);
1147                 NotifyPropertyChanged();
1148             }
1149         }
1150
1151         /// <summary>
1152         /// Gets or sets the world orientation of the view.<br />
1153         /// </summary>
1154         /// <since_tizen> 3 </since_tizen>
1155         public Rotation WorldOrientation
1156         {
1157             get
1158             {
1159                 Rotation temp = new Rotation();
1160                 GetProperty(View.Property.WORLD_ORIENTATION).Get(temp);
1161                 return temp;
1162             }
1163         }
1164
1165         /// <summary>
1166         /// Gets or sets the scale factor applied to the view.<br />
1167         /// </summary>
1168         /// <remarks>
1169         /// <para>
1170         /// Animatable - This property can be animated using <c>Animation</c> class.
1171         /// </para>
1172         /// The property cascade chaining set is possible. For example, this (view.Scale.X = 0.1f;) is possible.
1173         /// </remarks>
1174         /// <since_tizen> 3 </since_tizen>
1175         public Vector3 Scale
1176         {
1177             get
1178             {
1179                 Vector3 temp = (Vector3)GetValue(ScaleProperty);
1180                 return new Vector3(OnScaleChanged, temp.X, temp.Y, temp.Z);
1181             }
1182             set
1183             {
1184                 SetValue(ScaleProperty, value);
1185                 NotifyPropertyChanged();
1186             }
1187         }
1188
1189         /// <summary>
1190         /// Gets or sets the scale X factor applied to the view.
1191         /// </summary>
1192         /// <remarks>
1193         /// <para>
1194         /// Animatable - This property can be animated using <c>Animation</c> class.
1195         /// </para>
1196         /// </remarks>
1197         /// <since_tizen> 3 </since_tizen>
1198         public float ScaleX
1199         {
1200             get
1201             {
1202                 return (float)GetValue(ScaleXProperty);
1203             }
1204             set
1205             {
1206                 SetValue(ScaleXProperty, value);
1207                 NotifyPropertyChanged();
1208             }
1209         }
1210
1211         /// <summary>
1212         /// Gets or sets the scale Y factor applied to the view.
1213         /// </summary>
1214         /// <remarks>
1215         /// <para>
1216         /// Animatable - This property can be animated using <c>Animation</c> class.
1217         /// </para>
1218         /// </remarks>
1219         /// <since_tizen> 3 </since_tizen>
1220         public float ScaleY
1221         {
1222             get
1223             {
1224                 return (float)GetValue(ScaleYProperty);
1225             }
1226             set
1227             {
1228                 SetValue(ScaleYProperty, value);
1229                 NotifyPropertyChanged();
1230             }
1231         }
1232
1233         /// <summary>
1234         /// Gets or sets the scale Z factor applied to the view.
1235         /// </summary>
1236         /// <remarks>
1237         /// <para>
1238         /// Animatable - This property can be animated using <c>Animation</c> class.
1239         /// </para>
1240         /// </remarks>
1241         /// <since_tizen> 3 </since_tizen>
1242         public float ScaleZ
1243         {
1244             get
1245             {
1246                 return (float)GetValue(ScaleZProperty);
1247             }
1248             set
1249             {
1250                 SetValue(ScaleZProperty, value);
1251                 NotifyPropertyChanged();
1252             }
1253         }
1254
1255         /// <summary>
1256         /// Gets the world scale of the view.
1257         /// </summary>
1258         /// <since_tizen> 3 </since_tizen>
1259         public Vector3 WorldScale
1260         {
1261             get
1262             {
1263                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1264                 GetProperty(View.Property.WORLD_SCALE).Get(temp);
1265                 return temp;
1266             }
1267         }
1268
1269         /// <summary>
1270         /// Retrieves the visibility flag of the view.
1271         /// </summary>
1272         /// <remarks>
1273         /// <para>
1274         /// If the view is not visible, then the view and its children will not be rendered.
1275         /// 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.
1276         /// </para>
1277         /// <para>
1278         /// Animatable - This property can be animated using <c>Animation</c> class.
1279         /// </para>
1280         /// </remarks>
1281         /// <since_tizen> 3 </since_tizen>
1282         public bool Visibility
1283         {
1284             get
1285             {
1286                 bool temp = false;
1287                 GetProperty(View.Property.VISIBLE).Get(out temp);
1288                 return temp;
1289             }
1290         }
1291
1292         /// <summary>
1293         /// Gets the view's world color.
1294         /// </summary>
1295         /// <since_tizen> 3 </since_tizen>
1296         public Vector4 WorldColor
1297         {
1298             get
1299             {
1300                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
1301                 GetProperty(View.Property.WORLD_COLOR).Get(temp);
1302                 return temp;
1303             }
1304         }
1305
1306         /// <summary>
1307         /// Gets or sets the view's name.
1308         /// </summary>
1309         /// <since_tizen> 3 </since_tizen>
1310         public string Name
1311         {
1312             get
1313             {
1314                 return (string)GetValue(NameProperty);
1315             }
1316             set
1317             {
1318                 SetValue(NameProperty, value);
1319                 NotifyPropertyChanged();
1320             }
1321         }
1322
1323         /// <summary>
1324         /// Get the number of children held by the view.
1325         /// </summary>
1326         /// <since_tizen> 3 </since_tizen>
1327         public new uint ChildCount
1328         {
1329             get
1330             {
1331                 return GetChildCount();
1332             }
1333         }
1334
1335         /// <summary>
1336         /// Gets the view's ID.
1337         /// Readonly
1338         /// </summary>
1339         /// <since_tizen> 3 </since_tizen>
1340         public uint ID
1341         {
1342             get
1343             {
1344                 return GetId();
1345             }
1346         }
1347
1348         /// <summary>
1349         /// Gets or sets the status of whether the view should emit touch or hover signals.
1350         /// </summary>
1351         /// <since_tizen> 3 </since_tizen>
1352         public bool Sensitive
1353         {
1354             get
1355             {
1356                 return (bool)GetValue(SensitiveProperty);
1357             }
1358             set
1359             {
1360                 SetValue(SensitiveProperty, value);
1361                 NotifyPropertyChanged();
1362             }
1363         }
1364
1365         /// <summary>
1366         /// 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.
1367         /// </summary>
1368         /// <since_tizen> 3 </since_tizen>
1369         public bool LeaveRequired
1370         {
1371             get
1372             {
1373                 return (bool)GetValue(LeaveRequiredProperty);
1374             }
1375             set
1376             {
1377                 SetValue(LeaveRequiredProperty, value);
1378                 NotifyPropertyChanged();
1379             }
1380         }
1381
1382         /// <summary>
1383         /// Gets or sets the status of whether a child view inherits it's parent's orientation.
1384         /// </summary>
1385         /// <since_tizen> 3 </since_tizen>
1386         public bool InheritOrientation
1387         {
1388             get
1389             {
1390                 return (bool)GetValue(InheritOrientationProperty);
1391             }
1392             set
1393             {
1394                 SetValue(InheritOrientationProperty, value);
1395                 NotifyPropertyChanged();
1396             }
1397         }
1398
1399         /// <summary>
1400         /// Gets or sets the status of whether a child view inherits it's parent's scale.
1401         /// </summary>
1402         /// <since_tizen> 3 </since_tizen>
1403         public bool InheritScale
1404         {
1405             get
1406             {
1407                 return (bool)GetValue(InheritScaleProperty);
1408             }
1409             set
1410             {
1411                 SetValue(InheritScaleProperty, value);
1412                 NotifyPropertyChanged();
1413             }
1414         }
1415
1416         /// <summary>
1417         /// Gets or sets the status of how the view and its children should be drawn.<br />
1418         /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
1419         /// 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 />
1420         /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
1421         /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
1422         /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
1423         /// </summary>
1424         /// <since_tizen> 3 </since_tizen>
1425         public DrawModeType DrawMode
1426         {
1427             get
1428             {
1429                 return (DrawModeType)GetValue(DrawModeProperty);
1430             }
1431             set
1432             {
1433                 SetValue(DrawModeProperty, value);
1434                 NotifyPropertyChanged();
1435             }
1436         }
1437
1438         /// <summary>
1439         /// Gets or sets the relative to parent size factor of the view.<br />
1440         /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
1441         /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
1442         /// </summary>
1443         /// <remarks>
1444         /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
1445         /// </remarks>
1446         /// <since_tizen> 3 </since_tizen>
1447         public Vector3 SizeModeFactor
1448         {
1449             get
1450             {
1451                 Vector3 temp = (Vector3)GetValue(SizeModeFactorProperty);
1452                 return new Vector3(OnSizeModeFactorChanged, temp.X, temp.Y, temp.Z);
1453             }
1454             set
1455             {
1456                 SetValue(SizeModeFactorProperty, value);
1457                 NotifyPropertyChanged();
1458             }
1459         }
1460
1461         /// <summary>
1462         /// Gets or sets the width resize policy to be used.
1463         /// </summary>
1464         /// <since_tizen> 3 </since_tizen>
1465         public ResizePolicyType WidthResizePolicy
1466         {
1467             get
1468             {
1469                 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
1470             }
1471             set
1472             {
1473                 SetValue(WidthResizePolicyProperty, value);
1474                 // Match ResizePolicy to new Layouting.
1475                 // Parent relative policies can not be mapped at this point as parent size unknown.
1476                 switch (value)
1477                 {
1478                     case ResizePolicyType.UseNaturalSize:
1479                     {
1480                         WidthSpecification = LayoutParamPolicies.WrapContent;
1481                         break;
1482                     }
1483                     case ResizePolicyType.FillToParent:
1484                     {
1485                         WidthSpecification = LayoutParamPolicies.MatchParent;
1486                         break;
1487                     }
1488                     case ResizePolicyType.FitToChildren:
1489                     {
1490                         WidthSpecification = LayoutParamPolicies.WrapContent;
1491                         break;
1492                     }
1493                     default:
1494                         break;
1495                 }
1496                 NotifyPropertyChanged();
1497             }
1498         }
1499
1500         /// <summary>
1501         /// Gets or sets the height resize policy to be used.
1502         /// </summary>
1503         /// <since_tizen> 3 </since_tizen>
1504         public ResizePolicyType HeightResizePolicy
1505         {
1506             get
1507             {
1508                 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
1509             }
1510             set
1511             {
1512                 SetValue(HeightResizePolicyProperty, value);
1513                 // Match ResizePolicy to new Layouting.
1514                 // Parent relative policies can not be mapped at this point as parent size unknown.
1515                 switch (value)
1516                 {
1517                     case ResizePolicyType.UseNaturalSize:
1518                     {
1519                         HeightSpecification = LayoutParamPolicies.WrapContent;
1520                         break;
1521                     }
1522                     case ResizePolicyType.FillToParent:
1523                     {
1524                         HeightSpecification = LayoutParamPolicies.MatchParent;
1525                         break;
1526                     }
1527                     case ResizePolicyType.FitToChildren:
1528                     {
1529                         HeightSpecification = LayoutParamPolicies.WrapContent;
1530                         break;
1531                     }
1532                     default:
1533                         break;
1534                 }
1535                 NotifyPropertyChanged();
1536             }
1537         }
1538
1539         /// <summary>
1540         /// Gets or sets the policy to use when setting size with size negotiation.<br />
1541         /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
1542         /// </summary>
1543         /// <since_tizen> 3 </since_tizen>
1544         public SizeScalePolicyType SizeScalePolicy
1545         {
1546             get
1547             {
1548                 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
1549             }
1550             set
1551             {
1552                 SetValue(SizeScalePolicyProperty, value);
1553                 NotifyPropertyChanged();
1554             }
1555         }
1556
1557         /// <summary>
1558         ///  Gets or sets the status of whether the width size is dependent on the height size.
1559         /// </summary>
1560         /// <since_tizen> 3 </since_tizen>
1561         public bool WidthForHeight
1562         {
1563             get
1564             {
1565                 return (bool)GetValue(WidthForHeightProperty);
1566             }
1567             set
1568             {
1569                 SetValue(WidthForHeightProperty, value);
1570                 NotifyPropertyChanged();
1571             }
1572         }
1573
1574         /// <summary>
1575         /// Gets or sets the status of whether the height size is dependent on the width size.
1576         /// </summary>
1577         /// <since_tizen> 3 </since_tizen>
1578         public bool HeightForWidth
1579         {
1580             get
1581             {
1582                 return (bool)GetValue(HeightForWidthProperty);
1583             }
1584             set
1585             {
1586                 SetValue(HeightForWidthProperty, value);
1587                 NotifyPropertyChanged();
1588             }
1589         }
1590
1591         /// <summary>
1592         /// Gets or sets the padding for use in layout.
1593         /// </summary>
1594         /// <remarks>
1595         /// The property cascade chaining set is possible. For example, this (view.Padding.X = 0.1f;) is possible.
1596         /// </remarks>
1597         /// <since_tizen> 5 </since_tizen>
1598         public Extents Padding
1599         {
1600             get
1601             {
1602                 // If View has a Layout then padding in stored in the base Layout class
1603                 if (Layout !=null)
1604                 {
1605                     return Layout.Padding;
1606                 }
1607                 else
1608                 {
1609                     Extents temp = (Extents)GetValue(PaddingProperty);
1610                     return new Extents(OnPaddingChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
1611                 }
1612                 // Two return points to prevent creating a zeroed Extent native object before assignment
1613             }
1614             set
1615             {
1616                 Extents padding = value;
1617                 if (Layout !=null)
1618                 {
1619                     // Layout set so store Padding in LayoutItem instead of in View.
1620                     // If View stores the Padding value then Legacy Size Negotiation will overwrite
1621                     // the position and sizes measure in the Layouting.
1622                     Layout.Padding = value;
1623                     // If Layout is a LayoutItem then it could be a View that handles it's own padding.
1624                     // Let the View keeps it's padding.  Still store Padding in Layout to reduce code paths.
1625                     if( Layout.GetType() != typeof(LayoutItem)) // If a Layout container of some kind.
1626                     {
1627                         padding =  new Extents(0,0,0,0); // Reset value stored in View.
1628                     }
1629                     _layout?.RequestLayout();
1630                 }
1631                 SetValue(PaddingProperty, padding);
1632                 NotifyPropertyChanged();
1633                 _layout?.RequestLayout();
1634             }
1635         }
1636
1637         /// <summary>
1638         /// Gets or sets the minimum size the view can be assigned in size negotiation.
1639         /// </summary>
1640         /// <remarks>
1641         /// The property cascade chaining set is possible. For example, this (view.MinimumSize.Width = 1;) is possible.
1642         /// </remarks>
1643         /// <since_tizen> 3 </since_tizen>
1644         public Size2D MinimumSize
1645         {
1646             get
1647             {
1648                 Size2D tmp = (Size2D)GetValue(MinimumSizeProperty);
1649                 return new Size2D(OnMinimumSizeChanged, tmp.Width, tmp.Height);
1650             }
1651             set
1652             {
1653                 if (_layout != null)
1654                 {
1655                     // Note: it only works if minimum size is >= than natural size.
1656                     // To force the size it should be done through the width&height spec or Size2D.
1657                     _layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
1658                     _layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
1659                     _layout.RequestLayout();
1660                 }
1661                 SetValue(MinimumSizeProperty, value);
1662                 NotifyPropertyChanged();
1663             }
1664         }
1665
1666         /// <summary>
1667         /// Gets or sets the maximum size the view can be assigned in size negotiation.
1668         /// </summary>
1669         /// <remarks>
1670         /// The property cascade chaining set is possible. For example, this (view.MaximumSize.Width = 1;) is possible.
1671         /// </remarks>
1672         /// <since_tizen> 3 </since_tizen>
1673         public Size2D MaximumSize
1674         {
1675             get
1676             {
1677                 Size2D tmp = (Size2D)GetValue(MaximumSizeProperty);
1678                 return new Size2D(OnMaximumSizeChanged, tmp.Width, tmp.Height);
1679             }
1680             set
1681             {
1682                 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
1683                 // MATCH_PARENT spec + parent container size can be used to limit
1684                 if (_layout != null)
1685                 {
1686                     // Note: it only works if minimum size is >= than natural size.
1687                     // To force the size it should be done through the width&height spec or Size2D.
1688                     _layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Width);
1689                     _layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Height);
1690                     _layout.RequestLayout();
1691                 }
1692                 SetValue(MaximumSizeProperty, value);
1693                 NotifyPropertyChanged();
1694             }
1695         }
1696
1697         /// <summary>
1698         /// Gets or sets whether a child view inherits it's parent's position.<br />
1699         /// Default is to inherit.<br />
1700         /// 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 />
1701         /// </summary>
1702         /// <since_tizen> 3 </since_tizen>
1703         public bool InheritPosition
1704         {
1705             get
1706             {
1707                 return (bool)GetValue(InheritPositionProperty);
1708             }
1709             set
1710             {
1711                 SetValue(InheritPositionProperty, value);
1712                 NotifyPropertyChanged();
1713             }
1714         }
1715
1716         /// <summary>
1717         /// Gets or sets the clipping behavior (mode) of it's children.
1718         /// </summary>
1719         /// <since_tizen> 3 </since_tizen>
1720         public ClippingModeType ClippingMode
1721         {
1722             get
1723             {
1724                 return (ClippingModeType)GetValue(ClippingModeProperty);
1725             }
1726             set
1727             {
1728                 SetValue(ClippingModeProperty, value);
1729                 NotifyPropertyChanged();
1730             }
1731         }
1732
1733         /// <summary>
1734         /// Gets the number of renderers held by the view.
1735         /// </summary>
1736         /// <since_tizen> 3 </since_tizen>
1737         public uint RendererCount
1738         {
1739             get
1740             {
1741                 return GetRendererCount();
1742             }
1743         }
1744
1745         /// <summary>
1746         /// Deprecated in API5; Will be removed in API8. Please use PivotPoint instead!
1747         /// </summary>
1748         /// <remarks>
1749         /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
1750         /// </remarks>
1751         /// <since_tizen> 3 </since_tizen>
1752         [Obsolete("Deprecated in API5; Will be removed in API8. Please use PivotPoint instead! " +
1753             "Like: " +
1754             "View view = new View(); " +
1755             "view.PivotPoint = PivotPoint.Center; " +
1756             "view.PositionUsesPivotPoint = true;")]
1757         [EditorBrowsable(EditorBrowsableState.Never)]
1758         public Position AnchorPoint
1759         {
1760             get
1761             {
1762                 Position temp = new Position(0.0f, 0.0f, 0.0f);
1763                 GetProperty(View.Property.ANCHOR_POINT).Get(temp);
1764                 return new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
1765             }
1766             set
1767             {
1768                 SetProperty(View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
1769                 NotifyPropertyChanged();
1770             }
1771         }
1772
1773         /// <summary>
1774         /// Sets the size of a view for the width, the height and the depth.<br />
1775         /// Geometry can be scaled to fit within this area.<br />
1776         /// This does not interfere with the view's scale factor.<br />
1777         /// The views default depth is the minimum of width and height.<br />
1778         /// </summary>
1779         /// <remarks>
1780         /// <para>
1781         /// Animatable - This property can be animated using <c>Animation</c> class.
1782         /// </para>
1783         /// The property cascade chaining set is possible. For example, this (view.Size.Width = 1.0f;) is possible.
1784         /// </remarks>
1785         /// <since_tizen> 5 </since_tizen>
1786         public Size Size
1787         {
1788             get
1789             {
1790                 Size tmp = (Size)GetValue(SizeProperty);
1791                 return new Size(OnSizeChanged, tmp.Width, tmp.Height, tmp.Depth);
1792             }
1793             set
1794             {
1795                 SetValue(SizeProperty, value);
1796                 // Set Specification so when layouts measure this View it matches the value set here.
1797                 // All Views are currently Layouts.
1798                 WidthSpecification = (int)Math.Ceiling(value.Width);
1799                 HeightSpecification = (int)Math.Ceiling(value.Height);
1800                 NotifyPropertyChanged();
1801             }
1802         }
1803
1804         /// <summary>
1805         /// Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead!
1806         /// </summary>
1807         /// <since_tizen> 3 </since_tizen>
1808         [Obsolete("Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead! " +
1809             "Like: " +
1810             "Container parent =  view.GetParent(); " +
1811             "View view = parent as View;")]
1812         [EditorBrowsable(EditorBrowsableState.Never)]
1813         public new View Parent
1814         {
1815             get
1816             {
1817                 View ret;
1818                 IntPtr cPtr = Interop.Actor.Actor_GetParent(swigCPtr);
1819                 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
1820                 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
1821
1822                 if (basehandle is Layer layer)
1823                 {
1824                     ret = new View(Layer.getCPtr(layer).Handle, false);
1825                     NUILog.Error("This Parent property is deprecated, shoud do not be used");
1826                 }
1827                 else
1828                 {
1829                     ret = basehandle as View;
1830                 }
1831
1832                 Interop.BaseHandle.delete_BaseHandle(CPtr);
1833                 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
1834
1835                 if (NDalicPINVOKE.SWIGPendingException.Pending)
1836                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1837                 return ret;
1838             }
1839         }
1840
1841         /// <summary>
1842         /// Gets/Sets whether inherit parent's the layout Direction.
1843         /// </summary>
1844         /// <since_tizen> 4 </since_tizen>
1845         public bool InheritLayoutDirection
1846         {
1847             get
1848             {
1849                 return (bool)GetValue(InheritLayoutDirectionProperty);
1850             }
1851             set
1852             {
1853                 SetValue(InheritLayoutDirectionProperty, value);
1854                 NotifyPropertyChanged();
1855             }
1856         }
1857
1858         /// <summary>
1859         /// Gets/Sets the layout Direction.
1860         /// </summary>
1861         /// <since_tizen> 4 </since_tizen>
1862         public ViewLayoutDirectionType LayoutDirection
1863         {
1864             get
1865             {
1866                 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
1867             }
1868             set
1869             {
1870                 SetValue(LayoutDirectionProperty, value);
1871                 NotifyPropertyChanged();
1872                 _layout?.RequestLayout();
1873             }
1874         }
1875
1876         /// <summary>
1877         /// Gets or sets the Margin for use in layout.
1878         /// </summary>
1879         /// <remarks>
1880         /// Margin property is supported by Layout algorithms and containers.
1881         /// Please Set Layout if you want to use Margin property.
1882         /// The property cascade chaining set is possible. For example, this (view.Margin.X = 0.1f;) is possible.
1883         /// </remarks>
1884         /// <since_tizen> 4 </since_tizen>
1885         public Extents Margin
1886         {
1887             get
1888             {
1889                 // If View has a Layout then margin is stored in Layout.
1890                 if (Layout != null)
1891                 {
1892                     return Layout.Margin;
1893                 }
1894                 else
1895                 {
1896                     // If Layout not set then return margin stored in View.
1897                     Extents temp = (Extents)GetValue(MarginProperty);
1898                     return new Extents(OnMarginChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
1899                 }
1900                 // Two return points to prevent creating a zeroed Extent native object before assignment
1901             }
1902             set
1903             {
1904                 if (Layout != null)
1905                 {
1906                     // Layout set so store Margin in LayoutItem instead of View.
1907                     // If View stores the Margin too then the Legacy Size Negotiation will
1908                     // overwrite the position and size values measured in the Layouting.
1909                     Layout.Margin = value;
1910                     SetValue(MarginProperty, new Extents(0,0,0,0));
1911                     _layout?.RequestLayout();
1912                 }
1913                 else
1914                 {
1915                     SetValue(MarginProperty, value);
1916                 }
1917                 NotifyPropertyChanged();
1918                 _layout?.RequestLayout();
1919             }
1920         }
1921
1922         ///<summary>
1923         /// The required policy for this dimension, LayoutParamPolicies enum or exact value.
1924         ///</summary>
1925         /// <since_tizen> 6 </since_tizen>
1926         public int WidthSpecification
1927         {
1928             get
1929             {
1930                 return _widthPolicy;
1931             }
1932             set
1933             {
1934                 _widthPolicy = value;
1935                 if( _oldWidthPolicy != _widthPolicy )
1936                 {
1937                     if (_widthPolicy >= 0)
1938                     {
1939                         _measureSpecificationWidth = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly );
1940
1941                         if(_heightPolicy>=0) // Policy an exact value
1942                         {
1943                             Size2D.Width = _widthPolicy;
1944                         }
1945                         else
1946                         {
1947                             // Store _heightPolicy in the Size2D memember as will be reset to 0 by a Size2D callback.
1948                             // Size2D height will store the specification value (negative number) this will then be applied to the
1949                             // HeightSpecification when the Size2D callback is invoked.
1950                             Size2D = new Size2D(_widthPolicy,_heightPolicy);
1951                         }
1952                     }
1953                     _layout?.RequestLayout();
1954                     _oldWidthPolicy = _widthPolicy;
1955                 }
1956             }
1957         }
1958
1959         ///<summary>
1960         /// The required policy for this dimension, LayoutParamPolicies enum or exact value.
1961         ///</summary>
1962         /// <since_tizen> 6 </since_tizen>
1963         public int HeightSpecification
1964         {
1965             get
1966             {
1967                 return _heightPolicy;
1968             }
1969             set
1970             {
1971                 _heightPolicy = value;
1972                 if( _oldHeightPolicy != _heightPolicy )
1973                 {
1974                     if (_heightPolicy >= 0)
1975                     {
1976                         _measureSpecificationHeight = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly );
1977
1978                         if(_widthPolicy>=0) // Policy an exact value
1979                         {
1980                             Size2D.Height = _heightPolicy;
1981                         }
1982                         else
1983                         {
1984                             // Store widthPolicy in the Size2D memember as will be reset to 0 by a Size2D callback.
1985                             // Size2D height will store the specification value (negative number) this will then be applied to the
1986                             // HeightSpecification when the Size2D callback is invoked.
1987                             Size2D = new Size2D(_widthPolicy,_heightPolicy);
1988                         }
1989
1990                     }
1991                     _layout?.RequestLayout();
1992                     _oldHeightPolicy = _heightPolicy;
1993                 }
1994             }
1995         }
1996
1997         ///<summary>
1998         /// Gets the List of transitions for this View.
1999         ///</summary>
2000         /// <since_tizen> 6 </since_tizen>
2001         public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2002         {
2003             get
2004             {
2005                 if (_layoutTransitions == null)
2006                 {
2007                     _layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2008                 }
2009                 return _layoutTransitions;
2010             }
2011         }
2012
2013         ///<summary>
2014         /// Set a layout transitions for this View.
2015         ///</summary>
2016         /// <remarks>
2017         /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2018         /// </remarks>
2019         /// <since_tizen> 6 </since_tizen>
2020         public LayoutTransition LayoutTransition
2021         {
2022             set
2023             {
2024                 if (_layoutTransitions == null)
2025                 {
2026                     _layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2027                 }
2028                 LayoutTransitionsHelper.AddTransitionForCondition(_layoutTransitions,value.Condition,value, true);
2029
2030                 AttachTransitionsToChildren(value);
2031             }
2032         }
2033
2034         /// <summary>
2035         /// Deprecated in API5; Will be removed in API8. Please use Padding instead.
2036         /// </summary>
2037         /// <remarks>
2038         /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2039         /// </remarks>
2040         /// <since_tizen> 4 </since_tizen>
2041         [Obsolete("Deprecated in API5; Will be removed in API8. Please use Padding instead.")]
2042         [EditorBrowsable(EditorBrowsableState.Never)]
2043         public Extents PaddingEX
2044         {
2045             get
2046             {
2047                 Extents temp = new Extents(0, 0, 0, 0);
2048                 GetProperty(View.Property.PADDING).Get(temp);
2049                 return new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2050             }
2051             set
2052             {
2053                 SetProperty(View.Property.PADDING, new Tizen.NUI.PropertyValue(value));
2054                 NotifyPropertyChanged();
2055                 _layout?.RequestLayout();
2056             }
2057         }
2058
2059         /// <since_tizen> 6 </since_tizen>
2060         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2061         [EditorBrowsable(EditorBrowsableState.Never)]
2062         public Style XamlStyle
2063         {
2064             get
2065             {
2066                 return (Style)GetValue(XamlStyleProperty);
2067             }
2068             set
2069             {
2070                 SetValue(XamlStyleProperty, value);
2071             }
2072         }
2073
2074         /// <summary>
2075         /// The Color of View. This is an RGBA value.
2076         /// </summary>
2077         /// <remarks>
2078         /// <para>
2079         /// Animatable - This property can be animated using <c>Animation</c> class.
2080         /// </para>
2081         /// The property cascade chaining set is possible. For example, this (view.Color.X = 0.1f;) is possible.
2082         /// </remarks>
2083         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2084         [EditorBrowsable(EditorBrowsableState.Never)]
2085         public Color Color
2086         {
2087             get
2088             {
2089                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
2090                 GetProperty(Interop.ActorProperty.Actor_Property_COLOR_get()).Get(temp);
2091                 return new Color(OnColorChanged, temp.R, temp.G, temp.B, temp.A);
2092             }
2093             set
2094             {
2095                 SetColor(value);
2096             }
2097         }
2098
2099         /// <summary>
2100         /// Set the layout on this View. Replaces any existing Layout.
2101         /// </summary>
2102         /// <since_tizen> 6 </since_tizen>
2103         public LayoutItem Layout
2104         {
2105             get
2106             {
2107                 return _layout;
2108             }
2109             set
2110             {
2111                 // Do nothing if layout provided is already set on this View.
2112                 if (value == _layout)
2113                 {
2114                     return;
2115                 }
2116
2117                 Log.Info("NUI", "Setting Layout on:" + Name + "\n");
2118                 layoutingDisabled = false;
2119                 layoutSet = true;
2120
2121                 // If new layout being set already has a owner then that owner receives a replacement default layout.
2122                 // First check if the layout to be set already has a owner.
2123                 if (value?.Owner != null)
2124                 {
2125                     // Previous owner of the layout gets a default layout as a replacement.
2126                     value.Owner.Layout = new LayoutGroup();
2127
2128                     // Copy Margin and Padding to replacement LayoutGroup.
2129                     value.Owner.Layout.Margin = value.Margin;
2130                     value.Owner.Layout.Padding = value.Padding;
2131                 }
2132
2133                 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2134                 // View if no replacement. Previously margin and padding values would have been moved from
2135                 // the View to the layout.
2136                 if (_layout != null ) // Existing layout
2137                 {
2138                     if (value != null)
2139                     {
2140                         // Existing layout being replaced so copy over margin and padding values.
2141                         value.Margin = _layout.Margin;
2142                         value.Padding = _layout.Padding;
2143                     }
2144                     else
2145                     {
2146                       // Layout not being replaced so restore margin and padding to View.
2147                       SetValue(MarginProperty, _layout.Margin);
2148                       SetValue(PaddingProperty, _layout.Padding);
2149                       NotifyPropertyChanged();
2150                     }
2151                 }
2152                 else
2153                 {
2154                     // First Layout to be added to the View hence copy
2155
2156                     // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2157                     if (value !=null)
2158                     {
2159                         if (Margin.Top != 0 || Margin.Bottom !=0 || Margin.Start !=0 || Margin.End != 0)
2160                         {
2161                             // If View already has a margin set then store it in Layout instead.
2162                             value.Margin = Margin;
2163                             SetValue(MarginProperty, new Extents(0,0,0,0));
2164                             NotifyPropertyChanged();
2165                         }
2166
2167                         if (Padding.Top != 0 || Padding.Bottom !=0 || Padding.Start !=0 || Padding.End != 0)
2168                         {
2169                             // If View already has a padding set then store it in Layout instead.
2170                             value.Padding = Padding;
2171                             SetValue(PaddingProperty, new Extents(0,0,0,0));
2172                             NotifyPropertyChanged();
2173                         }
2174                     }
2175                 }
2176
2177                 // Remove existing layout from it's parent layout group.
2178                 _layout?.Unparent();
2179
2180                 // Set layout to this view
2181                 SetLayout(value);
2182             }
2183         }
2184
2185         /// <summary>
2186         /// The weight of the View, used to share available space in a layout with siblings.
2187         /// </summary>
2188         /// <since_tizen> 6 </since_tizen>
2189         public float Weight
2190         {
2191             get
2192             {
2193                 return _weight;
2194             }
2195             set
2196             {
2197                 _weight = value;
2198                 _layout?.RequestLayout();
2199             }
2200         }
2201
2202         /// <summary>
2203         ///  Whether to load the BackgroundImage synchronously.
2204         ///  If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
2205         ///  Note: For Normal Quad images only.
2206         /// </summary>
2207         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2208         [EditorBrowsable(EditorBrowsableState.Never)]
2209         public bool BackgroundImageSynchronosLoading
2210         {
2211             get
2212             {
2213                 return _backgroundImageSynchronosLoading;
2214             }
2215             set
2216             {
2217                 _backgroundImageSynchronosLoading = value;
2218                 string bgUrl = "";
2219                 int visualType = 0;
2220                 Background.Find(Visual.Property.Type)?.Get(out visualType);
2221                 if (visualType == (int)Visual.Type.Image)
2222                 {
2223                     Background.Find(ImageVisualProperty.URL)?.Get(out bgUrl);
2224                 }
2225
2226                 if (bgUrl.Length != 0)
2227                 {
2228                     PropertyMap bgMap = this.Background;
2229                     bgMap.Add("synchronousLoading", new PropertyValue(_backgroundImageSynchronosLoading));
2230                     Background = bgMap;
2231                 }
2232             }
2233         }
2234
2235         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2236         [EditorBrowsable(EditorBrowsableState.Never)]
2237         public Vector2 UpdateSizeHint
2238         {
2239             get
2240             {
2241                 return (Vector2)GetValue(UpdateSizeHintProperty);
2242             }
2243             set
2244             {
2245                 SetValue(UpdateSizeHintProperty, value);
2246                 NotifyPropertyChanged();
2247             }
2248         }
2249
2250         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
2251         [EditorBrowsable(EditorBrowsableState.Never)]
2252         public string[] TransitionNames
2253         {
2254             get
2255             {
2256                 return transitionNames;
2257             }
2258             set
2259             {
2260                 transitionNames = value;
2261                 LoadTransitions();
2262             }
2263         }
2264
2265         /// <summary>
2266         /// Get Style, it is abstract function and must be override.
2267         /// </summary>
2268         /// <since_tizen> 6 </since_tizen>
2269         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2270         [EditorBrowsable(EditorBrowsableState.Never)]
2271         protected virtual ViewStyle GetViewStyle()
2272         {
2273             return new ViewStyle();
2274         }
2275
2276         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2277         [EditorBrowsable(EditorBrowsableState.Never)]
2278         protected virtual bool OnControlStateChanged(ControlStates currentState)
2279         {
2280             //If need to apply the state to all child, return true;
2281             return true;
2282         }
2283         internal static readonly BindableProperty BackgroundImageSelectorProperty = BindableProperty.Create("BackgroundImageSelector", typeof(Selector<string>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
2284         {
2285             var view = (View)bindable;
2286             view.backgroundImageSelector.Clone((Selector<string>)newValue);
2287         },
2288         defaultValueCreator: (bindable) =>
2289         {
2290             var view = (View)bindable;
2291             return view.backgroundImageSelector;
2292         });
2293         private TriggerableSelector<string> _backgroundImageSelector;
2294         private TriggerableSelector<string> backgroundImageSelector
2295         {
2296             get
2297             {
2298                 if (null == _backgroundImageSelector)
2299                 {
2300                     _backgroundImageSelector = new TriggerableSelector<string>(this, BackgroundImageProperty);
2301                 }
2302                 return _backgroundImageSelector;
2303             }
2304         }
2305         internal static readonly BindableProperty BackgroundColorSelectorProperty = BindableProperty.Create("BackgroundColorSelector", typeof(Selector<Color>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
2306         {
2307             var view = (View)bindable;
2308             view.backgroundColorSelector.Clone((Selector<Color>)newValue);
2309         },
2310         defaultValueCreator: (bindable) =>
2311         {
2312             var view = (View)bindable;
2313             return view.backgroundColorSelector;
2314         });
2315         private TriggerableSelector<Color> _backgroundColorSelector;
2316         private TriggerableSelector<Color> backgroundColorSelector
2317         {
2318             get
2319             {
2320                 if (null == _backgroundColorSelector)
2321                 {
2322                     _backgroundColorSelector = new TriggerableSelector<Color>(this, BackgroundColorProperty);
2323                 }
2324                 return _backgroundColorSelector;
2325             }
2326         }
2327         internal static readonly BindableProperty BackgroundImageBorderSelectorProperty = BindableProperty.Create("BackgroundImageBorderSelector", typeof(Selector<Rectangle>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
2328         {
2329             var view = (View)bindable;
2330             view.backgroundImageBorderSelector.Clone((Selector<Rectangle>)newValue);
2331         },
2332         defaultValueCreator: (bindable) =>
2333         {
2334             var view = (View)bindable;
2335             return view.backgroundImageBorderSelector;
2336         });
2337         private TriggerableSelector<Rectangle> _backgroundImageBorderSelector;
2338         private TriggerableSelector<Rectangle> backgroundImageBorderSelector
2339         {
2340             get
2341             {
2342                 if (null == _backgroundImageBorderSelector)
2343                 {
2344                     _backgroundImageBorderSelector = new TriggerableSelector<Rectangle>(this, BackgroundImageBorderProperty);
2345                 }
2346                 return _backgroundImageBorderSelector;
2347             }
2348         }
2349         internal static readonly BindableProperty OpacitySelectorProperty = BindableProperty.Create("OpacitySelector", typeof(Selector<float?>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
2350         {
2351             var view = (View)bindable;
2352             view.opacitySelector.Clone((Selector<float?>)newValue);
2353         },
2354         defaultValueCreator: (bindable) =>
2355         {
2356             var view = (View)bindable;
2357             return view.opacitySelector;
2358         });
2359         private TriggerableSelector<float?> _opacitySelector;
2360         private TriggerableSelector<float?> opacitySelector
2361         {
2362             get
2363             {
2364                 if (null == _opacitySelector)
2365                 {
2366                     _opacitySelector = new TriggerableSelector<float?>(this, OpacityProperty);
2367                 }
2368                 return _opacitySelector;
2369             }
2370         }
2371
2372         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2373         [EditorBrowsable(EditorBrowsableState.Never)]
2374         public virtual void ApplyStyle(ViewStyle viewStyle)
2375         {
2376             if (null == viewStyle)
2377             {
2378                 return;
2379             }
2380
2381             if (this.viewStyle == viewStyle)
2382             {
2383                 return;
2384             }
2385
2386             if (null != this.viewStyle)
2387             {
2388                 simpleBinding.Clear();
2389             }
2390
2391             this.viewStyle = viewStyle;
2392
2393             Dictionary<string, BindableProperty> bindablePropertyOfView;
2394             Type viewType = GetType();
2395
2396             Dictionary<string, BindableProperty> bindablePropertyOfStyle;
2397             Type styleType = viewStyle.GetType();
2398
2399             BindableProperty.GetBindablePropertysOfType(viewType, out bindablePropertyOfView);
2400             BindableProperty.GetBindablePropertysOfType(styleType, out bindablePropertyOfStyle);
2401
2402             if (null != bindablePropertyOfView && null != bindablePropertyOfStyle)
2403             {
2404                 foreach (KeyValuePair<string, BindableProperty> keyValuePair in bindablePropertyOfStyle)
2405                 {
2406                     BindableProperty viewProperty;
2407                     bindablePropertyOfView.TryGetValue(keyValuePair.Key, out viewProperty);
2408
2409                     if (null != viewProperty)
2410                     {
2411                         object value = viewStyle.GetValue(keyValuePair.Value);
2412
2413                         if (null != value)
2414                         {
2415                             SetValue(viewProperty, value);
2416                         }
2417
2418                         simpleBinding.Bind(viewStyle, keyValuePair.Value, this, viewProperty, BindingDirection.TwoWay);
2419                     }
2420                 }
2421             }
2422         }
2423
2424         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2425         [EditorBrowsable(EditorBrowsableState.Never)]
2426         private BundledPipe simpleBinding = new BundledPipe();
2427     }
2428 }