2 * Copyright(c) 2019 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 using System.Collections.Generic;
19 using System.ComponentModel;
20 using System.Runtime.InteropServices;
21 using Tizen.NUI.Binding;
22 using Tizen.NUI.Components;
24 namespace Tizen.NUI.BaseComponents
27 /// View is the base class for all views.
29 /// <since_tizen> 3 </since_tizen>
30 public partial class View : Container, IResourcesProvider
33 /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
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;
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.
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;
48 private LayoutItem _layout; // Exclusive layout assigned to this View.
50 // List of transitions paired with the condition that uses the transition.
51 private Dictionary<TransitionCondition, TransitionList> _layoutTransitions;
52 private int _widthPolicy = LayoutParamPolicies.WrapContent; // Layout width policy
53 private int _heightPolicy = LayoutParamPolicies.WrapContent; // Layout height policy
54 private int _oldWidthPolicy = LayoutParamPolicies.MatchParent; // // Store Layout width to compare against later
55 private int _oldHeightPolicy = LayoutParamPolicies.MatchParent; // Store Layout height to compare against later
56 private float _weight = 0.0f; // Weighting of child View in a Layout
57 private MeasureSpecification _measureSpecificationWidth; // Layout width and internal Mode
58 private MeasureSpecification _measureSpecificationHeight; // Layout height and internal Mode
59 private bool _backgroundImageSynchronosLoading = false;
60 private Dictionary<string, Transition> transDictionary = new Dictionary<string, Transition>();
61 private string[] transitionNames;
62 private bool controlStatePropagation = false;
64 internal Size2D sizeSetExplicitly = new Size2D(); // Store size set by API, will be used in place of NaturalSize if not set.
65 internal BackgroundExtraData backgroundExtraData;
70 /// The Style instance binded with this View.
72 [EditorBrowsable(EditorBrowsableState.Never)]
73 protected 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
81 if (null == viewStyle)
83 ApplyStyle(GetViewStyle());
91 /// Creates a new instance of a view.
93 /// <since_tizen> 3 </since_tizen>
94 public View() : this(Interop.View.View_New(), true)
96 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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)
103 this.ViewStyle.CopyFrom(viewStyle);
107 /// Create a new instance of a View with setting the status of shown or hidden.
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)
114 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
118 internal View(View uiControl, bool shown = true) : this(Interop.View.new_View__SWIG_1(View.getCPtr(uiControl)), true)
120 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
126 backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
129 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
131 if (this.viewStyle == null)
133 ApplyStyle((viewStyle == null) ? GetViewStyle() : viewStyle.Clone());
137 this.viewStyle.CopyFrom(viewStyle);
141 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.View.View_SWIGUpcast(cPtr), cMemoryOwn)
145 PositionUsesPivotPoint = false;
148 _onWindowSendEventCallback = SendViewAddedEventToWindow;
149 this.OnWindowSignal().Connect(_onWindowSendEventCallback);
157 internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.new_View__SWIG_2(ViewImpl.getCPtr(implementation)), true)
159 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168 /// The event that is triggered when the View's ControlState is changed.
170 [EditorBrowsable(EditorBrowsableState.Never)]
171 public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
173 internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
175 private ControlStates controlStates;
177 /// Get/Set the control state.
179 /// <since_tizen> 6 </since_tizen>
180 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
181 [EditorBrowsable(EditorBrowsableState.Never)]
182 public ControlStates ControlState
186 return controlStates;
190 if (controlStates == value)
195 var prevState = controlStates;
197 controlStates = value;
199 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
201 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
203 OnControlStateChanged(changeInfo);
205 if (controlStatePropagation)
207 foreach (View child in Children)
209 child.ControlState = value;
213 ControlStateChangedEvent?.Invoke(this, changeInfo);
217 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
218 [EditorBrowsable(EditorBrowsableState.Never)]
219 public bool IsResourcesCreated
223 return Application.Current.IsResourcesCreated;
227 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
228 [EditorBrowsable(EditorBrowsableState.Never)]
229 public ResourceDictionary XamlResources
233 return Application.Current.XamlResources;
237 Application.Current.XamlResources = value;
242 /// The StyleName, type string.
244 /// <since_tizen> 3 </since_tizen>
245 public string StyleName
249 return (string)GetValue(StyleNameProperty);
253 SetValue(StyleNameProperty, value);
254 NotifyPropertyChanged();
259 /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
262 /// The property cascade chaining set is possible. For example, this (view.BackgroundColor.X = 0.1f;) is possible.
264 /// <since_tizen> 3 </since_tizen>
265 public Color BackgroundColor
269 Color temp = (Color)GetValue(BackgroundColorProperty);
270 return new Color(OnBackgroundColorChanged, temp.R, temp.G, temp.B, temp.A);
274 if (viewStyle != null)
276 viewStyle.BackgroundImage = null;
277 viewStyle.BackgroundColor = value;
281 SetValue(BackgroundColorProperty, value);
284 NotifyPropertyChanged();
289 /// The mutually exclusive with "backgroundColor" and "background" type Map.
291 /// <since_tizen> 3 </since_tizen>
292 public string BackgroundImage
296 return (string)GetValue(BackgroundImageProperty);
300 if (viewStyle != null)
302 viewStyle.BackgroundColor = null;
303 viewStyle.BackgroundImage = value;
307 SetValue(BackgroundImageProperty, value);
310 NotifyPropertyChanged();
315 /// Get or set the border of background image.
317 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
318 [EditorBrowsable(EditorBrowsableState.Never)]
319 public Rectangle BackgroundImageBorder
323 return (Rectangle)GetValue(BackgroundImageBorderProperty);
327 if (viewStyle != null)
329 viewStyle.BackgroundImageBorder = value;
333 SetValue(BackgroundImageBorderProperty, value);
336 NotifyPropertyChanged();
341 /// The background of view.
343 /// <since_tizen> 3 </since_tizen>
344 public Tizen.NUI.PropertyMap Background
348 return (PropertyMap)GetValue(BackgroundProperty);
352 SetValue(BackgroundProperty, value);
353 NotifyPropertyChanged();
358 /// Describes a shadow as an image for a View.
359 /// It is null by default.
362 /// Gettter returns copied instance of current shadow.
365 /// The mutually exclusive with "BoxShadow".
367 [EditorBrowsable(EditorBrowsableState.Never)]
368 public ImageShadow ImageShadow
372 return (ImageShadow)GetValue(ImageShadowProperty);
376 SetValue(ImageShadowProperty, value);
377 NotifyPropertyChanged();
382 /// Describes a box shaped shadow drawing for a View.
383 /// It is null by default.
386 /// Gettter returns copied instance of current shadow.
389 /// The mutually exclusive with "ImageShadow".
391 [EditorBrowsable(EditorBrowsableState.Never)]
392 public Shadow BoxShadow
396 return (Shadow)GetValue(BoxShadowProperty);
400 SetValue(BoxShadowProperty, value);
401 NotifyPropertyChanged();
406 /// The radius for the rounded corners of the View.
407 /// This will rounds background and shadow edges.
408 /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
410 [EditorBrowsable(EditorBrowsableState.Never)]
411 public float CornerRadius
415 return (float)GetValue(CornerRadiusProperty);
419 SetValue(CornerRadiusProperty, value);
420 NotifyPropertyChanged();
425 /// The current state of the view.
427 /// <since_tizen> 3 </since_tizen>
432 return (States)GetValue(StateProperty);
436 SetValue(StateProperty, value);
437 NotifyPropertyChanged();
442 /// The current sub state of the view.
444 /// <since_tizen> 3 </since_tizen>
445 public States SubState
449 return (States)GetValue(SubStateProperty);
453 SetValue(SubStateProperty, value);
454 NotifyPropertyChanged();
459 /// Displays a tooltip
461 /// <since_tizen> 3 </since_tizen>
462 public Tizen.NUI.PropertyMap Tooltip
466 return (PropertyMap)GetValue(TooltipProperty);
470 SetValue(TooltipProperty, value);
471 NotifyPropertyChanged();
476 /// Displays a tooltip as a text.
478 /// <since_tizen> 3 </since_tizen>
479 public string TooltipText
483 SetProperty(View.Property.TOOLTIP, new Tizen.NUI.PropertyValue(value));
484 NotifyPropertyChanged();
489 /// The Child property of FlexContainer.<br />
490 /// The proportion of the free space in the container, the flex item will receive.<br />
491 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
493 /// <since_tizen> 3 </since_tizen>
498 return (float)GetValue(FlexProperty);
502 SetValue(FlexProperty, value);
503 NotifyPropertyChanged();
508 /// The Child property of FlexContainer.<br />
509 /// The alignment of the flex item along the cross axis, which, if set, overides the default alignment for all items in the container.<br />
511 /// <since_tizen> 3 </since_tizen>
516 return (int)GetValue(AlignSelfProperty);
520 SetValue(AlignSelfProperty, value);
521 NotifyPropertyChanged();
526 /// The Child property of FlexContainer.<br />
527 /// The space around the flex item.<br />
530 /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
532 /// <since_tizen> 3 </since_tizen>
533 public Vector4 FlexMargin
537 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
538 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
542 SetValue(FlexMarginProperty, value);
543 NotifyPropertyChanged();
548 /// The top-left cell this child occupies, if not set, the first available cell is used.
551 /// The property cascade chaining set is possible. For example, this (view.CellIndex.X = 0.1f;) is possible.
553 /// <since_tizen> 3 </since_tizen>
554 public Vector2 CellIndex
558 Vector2 temp = (Vector2)GetValue(CellIndexProperty);
559 return new Vector2(OnCellIndexChanged, temp.X, temp.Y);
563 SetValue(CellIndexProperty, value);
564 NotifyPropertyChanged();
569 /// The number of rows this child occupies, if not set, the default value is 1.
571 /// <since_tizen> 3 </since_tizen>
576 return (float)GetValue(RowSpanProperty);
580 SetValue(RowSpanProperty, value);
581 NotifyPropertyChanged();
586 /// The number of columns this child occupies, if not set, the default value is 1.
588 /// <since_tizen> 3 </since_tizen>
589 public float ColumnSpan
593 return (float)GetValue(ColumnSpanProperty);
597 SetValue(ColumnSpanProperty, value);
598 NotifyPropertyChanged();
603 /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
605 /// <since_tizen> 3 </since_tizen>
606 public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
610 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
614 SetValue(CellHorizontalAlignmentProperty, value);
615 NotifyPropertyChanged();
620 /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
622 /// <since_tizen> 3 </since_tizen>
623 public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
627 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
631 SetValue(CellVerticalAlignmentProperty, value);
632 NotifyPropertyChanged();
637 /// The left focusable view.<br />
638 /// This will return null if not set.<br />
639 /// This will also return null if the specified left focusable view is not on a window.<br />
641 /// <since_tizen> 3 </since_tizen>
642 public View LeftFocusableView
644 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
647 return (View)GetValue(LeftFocusableViewProperty);
651 SetValue(LeftFocusableViewProperty, value);
652 NotifyPropertyChanged();
657 /// The right focusable view.<br />
658 /// This will return null if not set.<br />
659 /// This will also return null if the specified right focusable view is not on a window.<br />
661 /// <since_tizen> 3 </since_tizen>
662 public View RightFocusableView
664 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
667 return (View)GetValue(RightFocusableViewProperty);
671 SetValue(RightFocusableViewProperty, value);
672 NotifyPropertyChanged();
677 /// The up focusable view.<br />
678 /// This will return null if not set.<br />
679 /// This will also return null if the specified up focusable view is not on a window.<br />
681 /// <since_tizen> 3 </since_tizen>
682 public View UpFocusableView
684 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
687 return (View)GetValue(UpFocusableViewProperty);
691 SetValue(UpFocusableViewProperty, value);
692 NotifyPropertyChanged();
697 /// The down focusable view.<br />
698 /// This will return null if not set.<br />
699 /// This will also return null if the specified down focusable view is not on a window.<br />
701 /// <since_tizen> 3 </since_tizen>
702 public View DownFocusableView
704 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
707 return (View)GetValue(DownFocusableViewProperty);
711 SetValue(DownFocusableViewProperty, value);
712 NotifyPropertyChanged();
717 /// Whether the view should be focusable by keyboard navigation.
719 /// <since_tizen> 3 </since_tizen>
720 public bool Focusable
724 SetValue(FocusableProperty, value);
725 NotifyPropertyChanged();
729 return (bool)GetValue(FocusableProperty);
734 /// Retrieves the position of the view.<br />
735 /// The coordinates are relative to the view's parent.<br />
737 /// <since_tizen> 3 </since_tizen>
738 public Position CurrentPosition
742 return GetCurrentPosition();
747 /// Sets the size of a view for the width and the height.<br />
748 /// Geometry can be scaled to fit within this area.<br />
749 /// This does not interfere with the view's scale factor.<br />
750 /// The views default depth is the minimum of width and height.<br />
753 /// This NUI object (Size2D) typed property can be configured by multiple cascade setting. <br />
754 /// For example, this code ( view.Size2D.Width = 100; view.Size2D.Height = 100; ) is equivalent to this ( view.Size2D = new Size2D(100, 100); ). <br />
756 /// <since_tizen> 3 </since_tizen>
761 Size2D temp = (Size2D)GetValue(Size2DProperty);
762 return new Size2D(OnSize2DChanged, temp.Width, temp.Height);
766 sizeSetExplicitly = value; // Store size set by API, will be used in place of NaturalSize if not set.
767 SetValue(Size2DProperty, value);
768 // Set Specification so when layouts measure this View it matches the value set here.
769 // All Views are currently Layouts.
770 MeasureSpecificationWidth = new MeasureSpecification(new LayoutLength(value.Width), MeasureSpecification.ModeType.Exactly);
771 MeasureSpecificationHeight = new MeasureSpecification(new LayoutLength(value.Height), MeasureSpecification.ModeType.Exactly);
772 _widthPolicy = value.Width;
773 _heightPolicy = value.Height;
774 _layout?.RequestLayout();
775 NotifyPropertyChanged();
780 /// Retrieves the size of the view.<br />
781 /// The coordinates are relative to the view's parent.<br />
783 /// <since_tizen> 3 </since_tizen>
784 public Size2D CurrentSize
788 return GetCurrentSize();
793 /// Retrieves and sets the view's opacity.<br />
795 /// <since_tizen> 3 </since_tizen>
800 return (float)GetValue(OpacityProperty);
804 if (viewStyle != null)
806 viewStyle.Opacity = value;
810 SetValue(OpacityProperty, value);
813 NotifyPropertyChanged();
818 /// Sets the position of the view for X and Y.<br />
819 /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
820 /// If the position inheritance is disabled, sets the world position.<br />
823 /// This NUI object (Position2D) typed property can be configured by multiple cascade setting. <br />
824 /// For example, this code ( view.Position2D.X = 100; view.Position2D.Y = 100; ) is equivalent to this ( view.Position2D = new Position2D(100, 100); ). <br />
826 /// <since_tizen> 3 </since_tizen>
827 public Position2D Position2D
831 Position2D temp = (Position2D)GetValue(Position2DProperty);
832 return new Position2D(OnPosition2DChanged, temp.X, temp.Y);
836 SetValue(Position2DProperty, value);
837 NotifyPropertyChanged();
842 /// Retrieves the screen postion of the view.<br />
844 /// <since_tizen> 3 </since_tizen>
845 public Vector2 ScreenPosition
849 Vector2 temp = new Vector2(0.0f, 0.0f);
850 GetProperty(View.Property.SCREEN_POSITION).Get(temp);
856 /// Determines whether the pivot point should be used to determine the position of the view.
857 /// This is true by default.
859 /// <remarks>If false, then the top-left of the view is used for the position.
860 /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
862 /// <since_tizen> 3 </since_tizen>
863 public bool PositionUsesPivotPoint
867 return (bool)GetValue(PositionUsesPivotPointProperty);
871 SetValue(PositionUsesPivotPointProperty, value);
872 NotifyPropertyChanged();
877 /// Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead!
879 /// <since_tizen> 3 </since_tizen>
880 [Obsolete("Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead! " +
882 "View view = new View(); " +
883 "view.PivotPoint = PivotPoint.Center; " +
884 "view.PositionUsesPivotPoint = true;" +
885 " Deprecated in API5: Will be removed in API8")]
886 [EditorBrowsable(EditorBrowsableState.Never)]
887 public bool PositionUsesAnchorPoint
892 GetProperty(View.Property.POSITION_USES_ANCHOR_POINT).Get(out temp);
897 SetProperty(View.Property.POSITION_USES_ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
898 NotifyPropertyChanged();
903 /// Queries whether the view is connected to the stage.<br />
904 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
906 /// <since_tizen> 3 </since_tizen>
907 public bool IsOnWindow
916 /// Gets the depth in the hierarchy for the view.
918 /// <since_tizen> 3 </since_tizen>
919 public int HierarchyDepth
923 return GetHierarchyDepth();
928 /// Sets the sibling order of the view so the depth position can be defined within the same parent.
931 /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
932 /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
933 /// The values set by this property will likely change.
935 /// <since_tizen> 3 </since_tizen>
936 public int SiblingOrder
940 return (int)GetValue(SiblingOrderProperty);
944 SetValue(SiblingOrderProperty, value);
946 LayoutGroup layout = Layout as LayoutGroup;
947 layout?.ChangeLayoutSiblingOrder(value);
949 NotifyPropertyChanged();
954 /// Returns the natural size of the view.
957 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
959 /// <since_tizen> 5 </since_tizen>
960 public Vector3 NaturalSize
964 Vector3 ret = new Vector3(Interop.Actor.Actor_GetNaturalSize(swigCPtr), true);
965 if (NDalicPINVOKE.SWIGPendingException.Pending)
966 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
972 /// Returns the natural size (Size2D) of the view.
975 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
977 /// <since_tizen> 4 </since_tizen>
978 public Size2D NaturalSize2D
982 Vector3 temp = new Vector3(Interop.Actor.Actor_GetNaturalSize(swigCPtr), true);
983 if (NDalicPINVOKE.SWIGPendingException.Pending)
984 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
986 return new Size2D((int)temp.Width, (int)temp.Height);
991 /// Gets or sets the origin of a view within its parent's area.<br />
992 /// 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 />
993 /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
994 /// A view's position is the distance between this origin and the view's anchor-point.<br />
996 /// <pre>The view has been initialized.</pre>
997 /// <since_tizen> 3 </since_tizen>
998 public Position ParentOrigin
1002 Position tmp = (Position)GetValue(ParentOriginProperty);
1003 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1007 SetValue(ParentOriginProperty, value);
1008 NotifyPropertyChanged();
1013 /// Gets or sets the anchor-point of a view.<br />
1014 /// 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 />
1015 /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1016 /// A view position is the distance between its parent-origin and this anchor-point.<br />
1017 /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1018 /// <pre>The view has been initialized.</pre>
1021 /// The property cascade chaining set is possible. For example, this (view.PivotPoint.X = 0.1f;) is possible.
1023 /// <since_tizen> 3 </since_tizen>
1024 public Position PivotPoint
1028 Position tmp = (Position)GetValue(PivotPointProperty);
1029 return new Position(OnPivotPointChanged, tmp.X, tmp.Y, tmp.Z);
1033 SetValue(PivotPointProperty, value);
1034 NotifyPropertyChanged();
1039 /// Gets or sets the size width of the view.
1043 /// Animatable - This property can be animated using <c>Animation</c> class.
1046 /// <since_tizen> 3 </since_tizen>
1047 public float SizeWidth
1051 return (float)GetValue(SizeWidthProperty);
1055 SetValue(SizeWidthProperty, value);
1056 NotifyPropertyChanged();
1061 /// Gets or sets the size height of the view.
1065 /// Animatable - This property can be animated using <c>Animation</c> class.
1068 /// <since_tizen> 3 </since_tizen>
1069 public float SizeHeight
1073 return (float)GetValue(SizeHeightProperty);
1077 SetValue(SizeHeightProperty, value);
1078 NotifyPropertyChanged();
1083 /// Gets or sets the position of the view.<br />
1084 /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1085 /// If the position inheritance is disabled, sets the world position.<br />
1089 /// Animatable - This property can be animated using <c>Animation</c> class.
1091 /// The property cascade chaining set is possible. For example, this (view.Position.X = 1.0f;) is possible.
1093 /// <since_tizen> 3 </since_tizen>
1094 public Position Position
1098 Position tmp = (Position)GetValue(PositionProperty);
1099 return new Position(OnPositionChanged, tmp.X, tmp.Y, tmp.Z);
1103 SetValue(PositionProperty, value);
1104 NotifyPropertyChanged();
1109 /// Gets or sets the position X of the view.
1113 /// Animatable - This property can be animated using <c>Animation</c> class.
1116 /// <since_tizen> 3 </since_tizen>
1117 public float PositionX
1121 return (float)GetValue(PositionXProperty);
1125 SetValue(PositionXProperty, value);
1126 NotifyPropertyChanged();
1131 /// Gets or sets the position Y of the view.
1135 /// Animatable - This property can be animated using <c>Animation</c> class.
1138 /// <since_tizen> 3 </since_tizen>
1139 public float PositionY
1143 return (float)GetValue(PositionYProperty);
1147 SetValue(PositionYProperty, value);
1148 NotifyPropertyChanged();
1153 /// Gets or sets the position Z of the view.
1157 /// Animatable - This property can be animated using <c>Animation</c> class.
1160 /// <since_tizen> 3 </since_tizen>
1161 public float PositionZ
1165 return (float)GetValue(PositionZProperty);
1169 SetValue(PositionZProperty, value);
1170 NotifyPropertyChanged();
1175 /// Gets or sets the world position of the view.
1177 /// <since_tizen> 3 </since_tizen>
1178 public Vector3 WorldPosition
1182 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1183 GetProperty(View.Property.WORLD_POSITION).Get(temp);
1189 /// Gets or sets the orientation of the view.<br />
1190 /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1194 /// This is an asynchronous method.
1197 /// Animatable - This property can be animated using <c>Animation</c> class.
1200 /// <since_tizen> 3 </since_tizen>
1201 public Rotation Orientation
1205 return (Rotation)GetValue(OrientationProperty);
1209 SetValue(OrientationProperty, value);
1210 NotifyPropertyChanged();
1215 /// Gets or sets the world orientation of the view.<br />
1217 /// <since_tizen> 3 </since_tizen>
1218 public Rotation WorldOrientation
1222 Rotation temp = new Rotation();
1223 GetProperty(View.Property.WORLD_ORIENTATION).Get(temp);
1229 /// Gets or sets the scale factor applied to the view.<br />
1233 /// Animatable - This property can be animated using <c>Animation</c> class.
1235 /// The property cascade chaining set is possible. For example, this (view.Scale.X = 0.1f;) is possible.
1237 /// <since_tizen> 3 </since_tizen>
1238 public Vector3 Scale
1242 Vector3 temp = (Vector3)GetValue(ScaleProperty);
1243 return new Vector3(OnScaleChanged, temp.X, temp.Y, temp.Z);
1247 SetValue(ScaleProperty, value);
1248 NotifyPropertyChanged();
1253 /// Gets or sets the scale X factor applied to the view.
1257 /// Animatable - This property can be animated using <c>Animation</c> class.
1260 /// <since_tizen> 3 </since_tizen>
1265 return (float)GetValue(ScaleXProperty);
1269 SetValue(ScaleXProperty, value);
1270 NotifyPropertyChanged();
1275 /// Gets or sets the scale Y factor applied to the view.
1279 /// Animatable - This property can be animated using <c>Animation</c> class.
1282 /// <since_tizen> 3 </since_tizen>
1287 return (float)GetValue(ScaleYProperty);
1291 SetValue(ScaleYProperty, value);
1292 NotifyPropertyChanged();
1297 /// Gets or sets the scale Z factor applied to the view.
1301 /// Animatable - This property can be animated using <c>Animation</c> class.
1304 /// <since_tizen> 3 </since_tizen>
1309 return (float)GetValue(ScaleZProperty);
1313 SetValue(ScaleZProperty, value);
1314 NotifyPropertyChanged();
1319 /// Gets the world scale of the view.
1321 /// <since_tizen> 3 </since_tizen>
1322 public Vector3 WorldScale
1326 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1327 GetProperty(View.Property.WORLD_SCALE).Get(temp);
1333 /// Retrieves the visibility flag of the view.
1337 /// If the view is not visible, then the view and its children will not be rendered.
1338 /// 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.
1341 /// Animatable - This property can be animated using <c>Animation</c> class.
1344 /// <since_tizen> 3 </since_tizen>
1345 public bool Visibility
1350 GetProperty(View.Property.VISIBLE).Get(out temp);
1356 /// Gets the view's world color.
1358 /// <since_tizen> 3 </since_tizen>
1359 public Vector4 WorldColor
1363 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
1364 GetProperty(View.Property.WORLD_COLOR).Get(temp);
1370 /// Gets or sets the view's name.
1372 /// <since_tizen> 3 </since_tizen>
1377 return (string)GetValue(NameProperty);
1381 SetValue(NameProperty, value);
1382 NotifyPropertyChanged();
1387 /// Get the number of children held by the view.
1389 /// <since_tizen> 3 </since_tizen>
1390 public new uint ChildCount
1394 return GetChildCount();
1399 /// Gets the view's ID.
1402 /// <since_tizen> 3 </since_tizen>
1412 /// Gets or sets the status of whether the view should emit touch or hover signals.
1414 /// <since_tizen> 3 </since_tizen>
1415 public bool Sensitive
1419 return (bool)GetValue(SensitiveProperty);
1423 SetValue(SensitiveProperty, value);
1424 NotifyPropertyChanged();
1429 /// 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.
1431 /// <since_tizen> 3 </since_tizen>
1432 public bool LeaveRequired
1436 return (bool)GetValue(LeaveRequiredProperty);
1440 SetValue(LeaveRequiredProperty, value);
1441 NotifyPropertyChanged();
1446 /// Gets or sets the status of whether a child view inherits it's parent's orientation.
1448 /// <since_tizen> 3 </since_tizen>
1449 public bool InheritOrientation
1453 return (bool)GetValue(InheritOrientationProperty);
1457 SetValue(InheritOrientationProperty, value);
1458 NotifyPropertyChanged();
1463 /// Gets or sets the status of whether a child view inherits it's parent's scale.
1465 /// <since_tizen> 3 </since_tizen>
1466 public bool InheritScale
1470 return (bool)GetValue(InheritScaleProperty);
1474 SetValue(InheritScaleProperty, value);
1475 NotifyPropertyChanged();
1480 /// Gets or sets the status of how the view and its children should be drawn.<br />
1481 /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
1482 /// 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 />
1483 /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
1484 /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
1485 /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
1487 /// <since_tizen> 3 </since_tizen>
1488 public DrawModeType DrawMode
1492 return (DrawModeType)GetValue(DrawModeProperty);
1496 SetValue(DrawModeProperty, value);
1497 NotifyPropertyChanged();
1502 /// Gets or sets the relative to parent size factor of the view.<br />
1503 /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
1504 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
1507 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
1509 /// <since_tizen> 3 </since_tizen>
1510 public Vector3 SizeModeFactor
1514 Vector3 temp = (Vector3)GetValue(SizeModeFactorProperty);
1515 return new Vector3(OnSizeModeFactorChanged, temp.X, temp.Y, temp.Z);
1519 SetValue(SizeModeFactorProperty, value);
1520 NotifyPropertyChanged();
1525 /// Gets or sets the width resize policy to be used.
1527 /// <since_tizen> 3 </since_tizen>
1528 public ResizePolicyType WidthResizePolicy
1532 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
1536 SetValue(WidthResizePolicyProperty, value);
1537 NotifyPropertyChanged();
1542 /// Gets or sets the height resize policy to be used.
1544 /// <since_tizen> 3 </since_tizen>
1545 public ResizePolicyType HeightResizePolicy
1549 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
1553 SetValue(HeightResizePolicyProperty, value);
1554 NotifyPropertyChanged();
1559 /// Gets or sets the policy to use when setting size with size negotiation.<br />
1560 /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
1562 /// <since_tizen> 3 </since_tizen>
1563 public SizeScalePolicyType SizeScalePolicy
1567 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
1571 SetValue(SizeScalePolicyProperty, value);
1572 NotifyPropertyChanged();
1577 /// Gets or sets the status of whether the width size is dependent on the height size.
1579 /// <since_tizen> 3 </since_tizen>
1580 public bool WidthForHeight
1584 return (bool)GetValue(WidthForHeightProperty);
1588 SetValue(WidthForHeightProperty, value);
1589 NotifyPropertyChanged();
1594 /// Gets or sets the status of whether the height size is dependent on the width size.
1596 /// <since_tizen> 3 </since_tizen>
1597 public bool HeightForWidth
1601 return (bool)GetValue(HeightForWidthProperty);
1605 SetValue(HeightForWidthProperty, value);
1606 NotifyPropertyChanged();
1611 /// Gets or sets the padding for use in layout.
1614 /// The property cascade chaining set is possible. For example, this (view.Padding.X = 0.1f;) is possible.
1616 /// <since_tizen> 5 </since_tizen>
1617 public Extents Padding
1621 // If View has a Layout then padding in stored in the base Layout class
1624 return Layout.Padding;
1628 Extents temp = (Extents)GetValue(PaddingProperty);
1629 return new Extents(OnPaddingChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
1631 // Two return points to prevent creating a zeroed Extent native object before assignment
1635 Extents padding = value;
1638 // Layout set so store Padding in LayoutItem instead of in View.
1639 // If View stores the Padding value then Legacy Size Negotiation will overwrite
1640 // the position and sizes measure in the Layouting.
1641 Layout.Padding = value;
1642 // If Layout is a LayoutItem then it could be a View that handles it's own padding.
1643 // Let the View keeps it's padding. Still store Padding in Layout to reduce code paths.
1644 if( Layout.GetType() != typeof(LayoutItem)) // If a Layout container of some kind.
1646 padding = new Extents(0,0,0,0); // Reset value stored in View.
1648 _layout?.RequestLayout();
1650 SetValue(PaddingProperty, padding);
1651 NotifyPropertyChanged();
1652 _layout?.RequestLayout();
1657 /// Gets or sets the minimum size the view can be assigned in size negotiation.
1660 /// The property cascade chaining set is possible. For example, this (view.MinimumSize.Width = 1;) is possible.
1662 /// <since_tizen> 3 </since_tizen>
1663 public Size2D MinimumSize
1667 Size2D tmp = (Size2D)GetValue(MinimumSizeProperty);
1668 return new Size2D(OnMinimumSizeChanged, tmp.Width, tmp.Height);
1672 if (_layout != null)
1674 // Note: it only works if minimum size is >= than natural size.
1675 // To force the size it should be done through the width&height spec or Size2D.
1676 _layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
1677 _layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
1678 _layout.RequestLayout();
1680 SetValue(MinimumSizeProperty, value);
1681 NotifyPropertyChanged();
1686 /// Gets or sets the maximum size the view can be assigned in size negotiation.
1689 /// The property cascade chaining set is possible. For example, this (view.MaximumSize.Width = 1;) is possible.
1691 /// <since_tizen> 3 </since_tizen>
1692 public Size2D MaximumSize
1696 Size2D tmp = (Size2D)GetValue(MaximumSizeProperty);
1697 return new Size2D(OnMaximumSizeChanged, tmp.Width, tmp.Height);
1701 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
1702 // MATCH_PARENT spec + parent container size can be used to limit
1703 if (_layout != null)
1705 _layout.RequestLayout();
1707 SetValue(MaximumSizeProperty, value);
1708 NotifyPropertyChanged();
1713 /// Gets or sets whether a child view inherits it's parent's position.<br />
1714 /// Default is to inherit.<br />
1715 /// 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 />
1717 /// <since_tizen> 3 </since_tizen>
1718 public bool InheritPosition
1722 return (bool)GetValue(InheritPositionProperty);
1726 SetValue(InheritPositionProperty, value);
1727 NotifyPropertyChanged();
1732 /// Gets or sets the clipping behavior (mode) of it's children.
1734 /// <since_tizen> 3 </since_tizen>
1735 public ClippingModeType ClippingMode
1739 return (ClippingModeType)GetValue(ClippingModeProperty);
1743 SetValue(ClippingModeProperty, value);
1744 NotifyPropertyChanged();
1749 /// Gets the number of renderers held by the view.
1751 /// <since_tizen> 3 </since_tizen>
1752 public uint RendererCount
1756 return GetRendererCount();
1761 /// Deprecated in API5; Will be removed in API8. Please use PivotPoint instead!
1764 /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
1766 /// <since_tizen> 3 </since_tizen>
1767 [Obsolete("Deprecated in API5; Will be removed in API8. Please use PivotPoint instead! " +
1769 "View view = new View(); " +
1770 "view.PivotPoint = PivotPoint.Center; " +
1771 "view.PositionUsesPivotPoint = true;")]
1772 [EditorBrowsable(EditorBrowsableState.Never)]
1773 public Position AnchorPoint
1777 Position temp = new Position(0.0f, 0.0f, 0.0f);
1778 GetProperty(View.Property.ANCHOR_POINT).Get(temp);
1779 return new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
1783 SetProperty(View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
1784 NotifyPropertyChanged();
1789 /// Sets the size of a view for the width, the height and the depth.<br />
1790 /// Geometry can be scaled to fit within this area.<br />
1791 /// This does not interfere with the view's scale factor.<br />
1792 /// The views default depth is the minimum of width and height.<br />
1796 /// Animatable - This property can be animated using <c>Animation</c> class.
1798 /// The property cascade chaining set is possible. For example, this (view.Size.Width = 1.0f;) is possible.
1800 /// <since_tizen> 5 </since_tizen>
1805 Size tmp = (Size)GetValue(SizeProperty);
1806 return new Size(OnSizeChanged, tmp.Width, tmp.Height, tmp.Depth);
1810 SetValue(SizeProperty, value);
1811 NotifyPropertyChanged();
1816 /// Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead!
1818 /// <since_tizen> 3 </since_tizen>
1819 [Obsolete("Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead! " +
1821 "Container parent = view.GetParent(); " +
1822 "View view = parent as View;")]
1823 [EditorBrowsable(EditorBrowsableState.Never)]
1824 public new View Parent
1829 IntPtr cPtr = Interop.Actor.Actor_GetParent(swigCPtr);
1830 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
1831 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
1833 if (basehandle is Layer layer)
1835 ret = new View(Layer.getCPtr(layer).Handle, false);
1836 NUILog.Error("This Parent property is deprecated, shoud do not be used");
1840 ret = basehandle as View;
1843 Interop.BaseHandle.delete_BaseHandle(CPtr);
1844 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
1846 if (NDalicPINVOKE.SWIGPendingException.Pending)
1847 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1853 /// Gets/Sets whether inherit parent's the layout Direction.
1855 /// <since_tizen> 4 </since_tizen>
1856 public bool InheritLayoutDirection
1860 return (bool)GetValue(InheritLayoutDirectionProperty);
1864 SetValue(InheritLayoutDirectionProperty, value);
1865 NotifyPropertyChanged();
1870 /// Gets/Sets the layout Direction.
1872 /// <since_tizen> 4 </since_tizen>
1873 public ViewLayoutDirectionType LayoutDirection
1877 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
1881 SetValue(LayoutDirectionProperty, value);
1882 NotifyPropertyChanged();
1883 _layout?.RequestLayout();
1888 /// Gets or sets the Margin for use in layout.
1891 /// Margin property is supported by Layout algorithms and containers.
1892 /// Please Set Layout if you want to use Margin property.
1893 /// The property cascade chaining set is possible. For example, this (view.Margin.X = 0.1f;) is possible.
1895 /// <since_tizen> 4 </since_tizen>
1896 public Extents Margin
1900 // If View has a Layout then margin is stored in Layout.
1903 return Layout.Margin;
1907 // If Layout not set then return margin stored in View.
1908 Extents temp = (Extents)GetValue(MarginProperty);
1909 return new Extents(OnMarginChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
1911 // Two return points to prevent creating a zeroed Extent native object before assignment
1917 // Layout set so store Margin in LayoutItem instead of View.
1918 // If View stores the Margin too then the Legacy Size Negotiation will
1919 // overwrite the position and size values measured in the Layouting.
1920 Layout.Margin = value;
1921 SetValue(MarginProperty, new Extents(0,0,0,0));
1922 _layout?.RequestLayout();
1926 SetValue(MarginProperty, value);
1928 NotifyPropertyChanged();
1929 _layout?.RequestLayout();
1934 /// The required policy for this dimension, LayoutParamPolicies enum or exact value.
1936 /// <since_tizen> 6 </since_tizen>
1937 public int WidthSpecification
1941 return _widthPolicy;
1945 _widthPolicy = value;
1946 if( _oldWidthPolicy != _widthPolicy )
1948 if (_widthPolicy >= 0)
1950 _measureSpecificationWidth = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly );
1952 if(_heightPolicy>=0) // Policy an exact value
1954 Size2D.Width = _widthPolicy;
1958 // Store _heightPolicy in the Size2D memember as will be reset to 0 by a Size2D callback.
1959 // Size2D height will store the specification value (negative number) this will then be applied to the
1960 // HeightSpecification when the Size2D callback is invoked.
1961 Size2D = new Size2D(_widthPolicy,_heightPolicy);
1964 _layout?.RequestLayout();
1965 _oldWidthPolicy = _widthPolicy;
1971 /// The required policy for this dimension, LayoutParamPolicies enum or exact value.
1973 /// <since_tizen> 6 </since_tizen>
1974 public int HeightSpecification
1978 return _heightPolicy;
1982 _heightPolicy = value;
1983 if( _oldHeightPolicy != _heightPolicy )
1985 if (_heightPolicy >= 0)
1987 _measureSpecificationHeight = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly );
1989 if(_widthPolicy>=0) // Policy an exact value
1991 Size2D.Height = _heightPolicy;
1995 // Store widthPolicy in the Size2D memember as will be reset to 0 by a Size2D callback.
1996 // Size2D height will store the specification value (negative number) this will then be applied to the
1997 // HeightSpecification when the Size2D callback is invoked.
1998 Size2D = new Size2D(_widthPolicy,_heightPolicy);
2002 _layout?.RequestLayout();
2003 _oldHeightPolicy = _heightPolicy;
2009 /// Gets the List of transitions for this View.
2011 /// <since_tizen> 6 </since_tizen>
2012 public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2016 if (_layoutTransitions == null)
2018 _layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2020 return _layoutTransitions;
2025 /// Set a layout transitions for this View.
2028 /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2030 /// <since_tizen> 6 </since_tizen>
2031 public LayoutTransition LayoutTransition
2035 if (_layoutTransitions == null)
2037 _layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2039 LayoutTransitionsHelper.AddTransitionForCondition(_layoutTransitions,value.Condition,value, true);
2041 AttachTransitionsToChildren(value);
2046 /// Deprecated in API5; Will be removed in API8. Please use Padding instead.
2049 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2051 /// <since_tizen> 4 </since_tizen>
2052 [Obsolete("Deprecated in API5; Will be removed in API8. Please use Padding instead.")]
2053 [EditorBrowsable(EditorBrowsableState.Never)]
2054 public Extents PaddingEX
2058 Extents temp = new Extents(0, 0, 0, 0);
2059 GetProperty(View.Property.PADDING).Get(temp);
2060 return new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2064 SetProperty(View.Property.PADDING, new Tizen.NUI.PropertyValue(value));
2065 NotifyPropertyChanged();
2066 _layout?.RequestLayout();
2070 /// <since_tizen> 6 </since_tizen>
2071 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2072 [EditorBrowsable(EditorBrowsableState.Never)]
2073 public Style XamlStyle
2077 return (Style)GetValue(XamlStyleProperty);
2081 SetValue(XamlStyleProperty, value);
2086 /// The Color of View. This is an RGBA value.
2090 /// Animatable - This property can be animated using <c>Animation</c> class.
2092 /// The property cascade chaining set is possible. For example, this (view.Color.X = 0.1f;) is possible.
2094 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2095 [EditorBrowsable(EditorBrowsableState.Never)]
2100 Color temp = (Color)GetValue(ColorProperty);
2101 return new Color(OnColorChanged, temp.R, temp.G, temp.B, temp.A);
2105 if (viewStyle != null)
2107 viewStyle.Color = value;
2111 SetValue(ColorProperty, value);
2114 NotifyPropertyChanged();
2119 /// Set the layout on this View. Replaces any existing Layout.
2121 /// <since_tizen> 6 </since_tizen>
2122 public LayoutItem Layout
2130 // Do nothing if layout provided is already set on this View.
2131 if (value == _layout)
2136 Log.Info("NUI", "Setting Layout on:" + Name + "\n");
2137 layoutingDisabled = false;
2140 // If new layout being set already has a owner then that owner receives a replacement default layout.
2141 // First check if the layout to be set already has a owner.
2142 if (value?.Owner != null)
2144 // Previous owner of the layout gets a default layout as a replacement.
2145 value.Owner.Layout = new AbsoluteLayout();
2147 // Copy Margin and Padding to replacement LayoutGroup.
2148 value.Owner.Layout.Margin = value.Margin;
2149 value.Owner.Layout.Padding = value.Padding;
2152 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2153 // View if no replacement. Previously margin and padding values would have been moved from
2154 // the View to the layout.
2155 if (_layout != null ) // Existing layout
2159 // Existing layout being replaced so copy over margin and padding values.
2160 value.Margin = _layout.Margin;
2161 value.Padding = _layout.Padding;
2165 // Layout not being replaced so restore margin and padding to View.
2166 SetValue(MarginProperty, _layout.Margin);
2167 SetValue(PaddingProperty, _layout.Padding);
2168 NotifyPropertyChanged();
2173 // First Layout to be added to the View hence copy
2175 // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2178 if (Margin.Top != 0 || Margin.Bottom !=0 || Margin.Start !=0 || Margin.End != 0)
2180 // If View already has a margin set then store it in Layout instead.
2181 value.Margin = Margin;
2182 SetValue(MarginProperty, new Extents(0,0,0,0));
2183 NotifyPropertyChanged();
2186 if (Padding.Top != 0 || Padding.Bottom !=0 || Padding.Start !=0 || Padding.End != 0)
2188 // If View already has a padding set then store it in Layout instead.
2189 value.Padding = Padding;
2190 SetValue(PaddingProperty, new Extents(0,0,0,0));
2191 NotifyPropertyChanged();
2196 // Remove existing layout from it's parent layout group.
2197 _layout?.Unparent();
2199 // Set layout to this view
2205 /// The weight of the View, used to share available space in a layout with siblings.
2207 /// <since_tizen> 6 </since_tizen>
2217 _layout?.RequestLayout();
2222 /// Whether to load the BackgroundImage synchronously.
2223 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
2224 /// Note: For Normal Quad images only.
2226 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2227 [EditorBrowsable(EditorBrowsableState.Never)]
2228 public bool BackgroundImageSynchronosLoading
2232 return _backgroundImageSynchronosLoading;
2236 _backgroundImageSynchronosLoading = value;
2239 Background.Find(Visual.Property.Type)?.Get(out visualType);
2240 if (visualType == (int)Visual.Type.Image)
2242 Background.Find(ImageVisualProperty.URL)?.Get(out bgUrl);
2245 if (bgUrl.Length != 0)
2247 PropertyMap bgMap = this.Background;
2248 bgMap.Add("synchronousLoading", new PropertyValue(_backgroundImageSynchronosLoading));
2254 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2255 [EditorBrowsable(EditorBrowsableState.Never)]
2256 public Vector2 UpdateSizeHint
2260 return (Vector2)GetValue(UpdateSizeHintProperty);
2264 SetValue(UpdateSizeHintProperty, value);
2265 NotifyPropertyChanged();
2269 /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
2270 [EditorBrowsable(EditorBrowsableState.Never)]
2271 public string[] TransitionNames
2275 return transitionNames;
2279 transitionNames = value;
2285 /// Enable/Disable ControlState propagation for children.
2286 /// It is false by default.
2287 /// If the View needs to share ControlState with descendants, please set it true.
2288 /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
2290 [EditorBrowsable(EditorBrowsableState.Never)]
2291 public bool EnableControlStatePropagation
2293 get => controlStatePropagation;
2296 controlStatePropagation = value;
2298 foreach (View child in Children)
2300 child.EnableControlStatePropagation = value;
2306 /// Get Style, it is abstract function and must be override.
2308 /// <since_tizen> 6 </since_tizen>
2309 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2310 [EditorBrowsable(EditorBrowsableState.Never)]
2311 protected virtual ViewStyle GetViewStyle()
2313 return new ViewStyle();
2317 /// Called after the View's ControlStates changed.
2319 /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
2320 [EditorBrowsable(EditorBrowsableState.Never)]
2321 protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
2325 internal static readonly BindableProperty BackgroundImageSelectorProperty = BindableProperty.Create("BackgroundImageSelector", typeof(Selector<string>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
2327 var view = (View)bindable;
2328 view.backgroundImageSelector.Clone((Selector<string>)newValue);
2330 defaultValueCreator: (bindable) =>
2332 var view = (View)bindable;
2333 return view.backgroundImageSelector;
2335 private TriggerableSelector<string> _backgroundImageSelector;
2336 private TriggerableSelector<string> backgroundImageSelector
2340 if (null == _backgroundImageSelector)
2342 _backgroundImageSelector = new TriggerableSelector<string>(this, BackgroundImageProperty);
2344 return _backgroundImageSelector;
2347 internal static readonly BindableProperty BackgroundColorSelectorProperty = BindableProperty.Create("BackgroundColorSelector", typeof(Selector<Color>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
2349 var view = (View)bindable;
2350 view.backgroundColorSelector.Clone((Selector<Color>)newValue);
2352 defaultValueCreator: (bindable) =>
2354 var view = (View)bindable;
2355 return view.backgroundColorSelector;
2357 private TriggerableSelector<Color> _backgroundColorSelector;
2358 private TriggerableSelector<Color> backgroundColorSelector
2362 if (null == _backgroundColorSelector)
2364 _backgroundColorSelector = new TriggerableSelector<Color>(this, BackgroundColorProperty);
2366 return _backgroundColorSelector;
2370 internal static readonly BindableProperty ColorSelectorProperty = BindableProperty.Create("ColorSelector", typeof(Selector<Color>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
2372 var view = (View)bindable;
2373 view.colorSelector.Clone((Selector<Color>)newValue);
2375 defaultValueCreator: (bindable) =>
2377 var view = (View)bindable;
2378 return view.colorSelector;
2381 private TriggerableSelector<Color> _colorSelector;
2382 private TriggerableSelector<Color> colorSelector
2386 if (null == _colorSelector)
2388 _colorSelector = new TriggerableSelector<Color>(this, ColorProperty);
2390 return _colorSelector;
2394 internal static readonly BindableProperty BackgroundImageBorderSelectorProperty = BindableProperty.Create("BackgroundImageBorderSelector", typeof(Selector<Rectangle>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
2396 var view = (View)bindable;
2397 view.backgroundImageBorderSelector.Clone((Selector<Rectangle>)newValue);
2399 defaultValueCreator: (bindable) =>
2401 var view = (View)bindable;
2402 return view.backgroundImageBorderSelector;
2404 private TriggerableSelector<Rectangle> _backgroundImageBorderSelector;
2405 private TriggerableSelector<Rectangle> backgroundImageBorderSelector
2409 if (null == _backgroundImageBorderSelector)
2411 _backgroundImageBorderSelector = new TriggerableSelector<Rectangle>(this, BackgroundImageBorderProperty);
2413 return _backgroundImageBorderSelector;
2416 internal static readonly BindableProperty OpacitySelectorProperty = BindableProperty.Create("OpacitySelector", typeof(Selector<float?>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
2418 var view = (View)bindable;
2419 view.opacitySelector.Clone((Selector<float?>)newValue);
2421 defaultValueCreator: (bindable) =>
2423 var view = (View)bindable;
2424 return view.opacitySelector;
2426 private TriggerableSelector<float?> _opacitySelector;
2427 private TriggerableSelector<float?> opacitySelector
2431 if (null == _opacitySelector)
2433 _opacitySelector = new TriggerableSelector<float?>(this, OpacityProperty);
2435 return _opacitySelector;
2439 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2440 [EditorBrowsable(EditorBrowsableState.Never)]
2441 public virtual void ApplyStyle(ViewStyle viewStyle)
2443 if (null == viewStyle)
2448 if (this.viewStyle == viewStyle)
2453 if (null != this.viewStyle)
2455 simpleBinding.Clear();
2458 this.viewStyle = viewStyle;
2460 Dictionary<string, BindableProperty> bindablePropertyOfView;
2461 Type viewType = GetType();
2463 Dictionary<string, BindableProperty> bindablePropertyOfStyle;
2464 Type styleType = viewStyle.GetType();
2466 BindableProperty.GetBindablePropertysOfType(viewType, out bindablePropertyOfView);
2467 BindableProperty.GetBindablePropertysOfType(styleType, out bindablePropertyOfStyle);
2469 if (null != bindablePropertyOfView && null != bindablePropertyOfStyle)
2471 foreach (KeyValuePair<string, BindableProperty> keyValuePair in bindablePropertyOfStyle)
2473 BindableProperty viewProperty;
2474 bindablePropertyOfView.TryGetValue(keyValuePair.Key, out viewProperty);
2476 if (null != viewProperty)
2478 object value = viewStyle.GetValue(keyValuePair.Value);
2482 SetValue(viewProperty, value);
2485 simpleBinding.Bind(viewStyle, keyValuePair.Value, this, viewProperty, BindingDirection.TwoWay);
2491 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2492 [EditorBrowsable(EditorBrowsableState.Never)]
2493 private BundledPipe simpleBinding = new BundledPipe();