2 * Copyright(c) 2022 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;
23 namespace Tizen.NUI.BaseComponents
26 /// View is the base class for all views.
28 /// <since_tizen> 3 </since_tizen>
29 public partial class View : Container, IResourcesProvider
31 private static HashSet<BindableProperty> positionPropertyGroup = new HashSet<BindableProperty>();
32 private static HashSet<BindableProperty> sizePropertyGroup = new HashSet<BindableProperty>();
33 private static HashSet<BindableProperty> scalePropertyGroup = new HashSet<BindableProperty>();
34 private static bool defaultGrabTouchAfterLeave = false;
35 private static bool defaultAllowOnlyOwnTouch = false;
37 internal BackgroundExtraData backgroundExtraData;
39 private bool layoutSet = false;
40 private LayoutItem layout; // Exclusive layout assigned to this View.
42 // List of transitions paired with the condition that uses the transition.
43 private Dictionary<TransitionCondition, TransitionList> layoutTransitions;
44 private int widthPolicy = LayoutParamPolicies.WrapContent; // Layout width policy
45 private int heightPolicy = LayoutParamPolicies.WrapContent; // Layout height policy
46 private float weight = 0.0f; // Weighting of child View in a Layout
47 private bool backgroundImageSynchronousLoading = false;
48 private bool excludeLayouting = false;
49 private LayoutTransition layoutTransition;
50 private TransitionOptions transitionOptions = null;
51 private ThemeData themeData;
52 private bool isThemeChanged = false;
54 // List of constraints
55 private Constraint widthConstraint = null;
56 private Constraint heightConstraint = null;
58 private Size2D internalMaximumSize = null;
59 private Size2D internalMinimumSize = null;
60 private Extents internalMargin = null;
61 private Extents internalPadding = null;
62 private Vector3 internalSizeModeFactor = null;
63 private Vector2 internalCellIndex = null;
64 private Color internalBackgroundColor = null;
65 private Color internalColor = null;
66 private Position internalPivotPoint = null;
67 private Position internalPosition = null;
68 private Position2D internalPosition2D = null;
69 private Vector3 internalScale = null;
70 private Size internalSize = null;
71 private Size2D internalSize2D = null;
72 private int layoutCount = 0;
73 private ControlState propagatableControlStates = ControlState.All;
75 private string internalName = string.Empty;
76 private Position internalCurrentParentOrigin = null;
77 private Position internalCurrentAnchorPoint = null;
78 private Vector3 internalTargetSize = null;
79 private Size2D internalCurrentSize = null;
80 private Position internalCurrentPosition = null;
81 private Vector3 internalCurrentWorldPosition = null;
82 private Vector3 internalCurrentScale = null;
83 private Vector3 internalCurrentWorldScale = null;
84 private Vector4 internalCurrentColor = null;
85 private Vector4 internalCurrentWorldColor = null;
86 private Vector2 internalCurrentScreenPosition = null;
90 RegisterPropertyGroup(PositionProperty, positionPropertyGroup);
91 RegisterPropertyGroup(Position2DProperty, positionPropertyGroup);
92 RegisterPropertyGroup(PositionXProperty, positionPropertyGroup);
93 RegisterPropertyGroup(PositionYProperty, positionPropertyGroup);
95 RegisterPropertyGroup(SizeProperty, sizePropertyGroup);
96 RegisterPropertyGroup(Size2DProperty, sizePropertyGroup);
97 RegisterPropertyGroup(SizeWidthProperty, sizePropertyGroup);
98 RegisterPropertyGroup(SizeHeightProperty, sizePropertyGroup);
100 RegisterPropertyGroup(ScaleProperty, scalePropertyGroup);
101 RegisterPropertyGroup(ScaleXProperty, scalePropertyGroup);
102 RegisterPropertyGroup(ScaleYProperty, scalePropertyGroup);
103 RegisterPropertyGroup(ScaleZProperty, scalePropertyGroup);
105 RegisterAccessibilityDelegate();
109 /// Accessibility mode for controlling View's Accessible implementation.
110 /// It is only relevant when deriving custom controls from View directly,
111 /// as classes derived from CustomView (or any of its subclasses) get the
112 /// Custom mode by default.
114 [EditorBrowsable(EditorBrowsableState.Never)]
115 public enum ViewAccessibilityMode
118 /// Default accessibility implementation. Overriding View.Accessibility...()
119 /// virtual methods will have no effect.
121 [EditorBrowsable(EditorBrowsableState.Never)]
124 /// Custom accessibility implementation. Overriding View.Accessibility...()
125 /// will be necessary to provide accessibility support for the View.
127 [EditorBrowsable(EditorBrowsableState.Never)]
131 private static IntPtr NewWithAccessibilityMode(ViewAccessibilityMode accessibilityMode)
133 switch (accessibilityMode)
135 case ViewAccessibilityMode.Custom:
137 return Interop.View.NewCustom();
139 case ViewAccessibilityMode.Default:
142 return Interop.View.New();
148 /// Creates a new instance of a view.
150 /// <since_tizen> 3 </since_tizen>
151 public View() : this(ViewAccessibilityMode.Default)
155 [EditorBrowsable(EditorBrowsableState.Never)]
156 public View(ViewAccessibilityMode accessibilityMode) : this(NewWithAccessibilityMode(accessibilityMode), true)
158 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
161 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
162 [EditorBrowsable(EditorBrowsableState.Never)]
163 public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
168 /// Create a new instance of a View with setting the status of shown or hidden.
170 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
171 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
172 [EditorBrowsable(EditorBrowsableState.Never)]
173 public View(bool shown) : this(Interop.View.New(), true)
175 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
179 internal View(View uiControl, bool shown = true) : this(Interop.View.NewView(View.getCPtr(uiControl)), true)
181 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
187 backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
190 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
192 InitializeStyle(viewStyle);
195 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn)
199 PositionUsesPivotPoint = false;
200 GrabTouchAfterLeave = defaultGrabTouchAfterLeave;
201 AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch;
210 internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
212 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
221 /// The event that is triggered when the View's ControlState is changed.
223 [EditorBrowsable(EditorBrowsableState.Never)]
224 public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
226 internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
230 /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
232 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
233 [EditorBrowsable(EditorBrowsableState.Never)]
234 public bool LayoutSet
243 /// Flag to allow Layouting to be disabled for Views.
244 /// Once a View has a Layout set then any children added to Views from then on will receive
245 /// automatic Layouts.
247 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
248 [EditorBrowsable(EditorBrowsableState.Never)]
249 public static bool LayoutingDisabled { get; set; } = true;
252 /// If set to true, the <see cref="GrabTouchAfterLeave"/> property value is set to true when all Views are created.
254 /// <param name="enable">Sets value of GrabTouchAfterLeave property</param>
255 [EditorBrowsable(EditorBrowsableState.Never)]
256 public static void SetDefaultGrabTouchAfterLeave(bool enable)
258 defaultGrabTouchAfterLeave = enable;
262 /// If set to true, the <see cref="AllowOnlyOwnTouch"/> property value is set to true when all Views are created.
264 /// <param name="enable">Sets value of AllowOnlyOwnTouch property</param>
265 [EditorBrowsable(EditorBrowsableState.Never)]
266 public static void SetDefaultAllowOnlyOwnTouch(bool enable)
268 defaultAllowOnlyOwnTouch = enable;
272 /// Deprecate. Do not use this.
273 /// The style instance applied to this view.
274 /// Note that do not modify the ViewStyle.
275 /// Modifying ViewStyle will affect other views with same ViewStyle.
277 [EditorBrowsable(EditorBrowsableState.Never)]
278 protected ViewStyle ViewStyle
282 if (themeData == null) themeData = new ThemeData();
284 if (themeData.viewStyle == null)
286 ApplyStyle(CreateViewStyle());
288 return themeData.viewStyle;
293 /// Get/Set the control state.
294 /// Note that the ControlState only available for the classes derived from Control.
295 /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
296 /// please set <see cref="EnableControlState"/> to true.
298 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
299 [EditorBrowsable(EditorBrowsableState.Never)]
300 public ControlState ControlState
304 return themeData == null ? ControlState.Normal : themeData.controlStates;
308 if (ControlState == value)
313 var prevState = ControlState;
315 if (themeData == null) themeData = new ThemeData();
316 themeData.controlStates = value;
318 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
320 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
322 if (themeData.ControlStatePropagation)
324 foreach (View child in Children)
326 ControlState allowed = child.PropagatableControlStates;
327 if (allowed.Contains(ControlState.All))
329 child.ControlState = value;
333 ControlState newControlState = child.ControlState;
335 if (allowed.Contains(ControlState.Normal))
337 if (value.Contains(ControlState.Normal))
339 newControlState += ControlState.Normal;
343 newControlState -= ControlState.Normal;
347 if (allowed.Contains(ControlState.Disabled))
349 if (value.Contains(ControlState.Disabled))
351 newControlState += ControlState.Disabled;
355 newControlState -= ControlState.Disabled;
359 if (allowed.Contains(ControlState.Selected))
361 if (value.Contains(ControlState.Selected))
363 newControlState += ControlState.Selected;
367 newControlState -= ControlState.Selected;
371 if (allowed.Contains(ControlState.Pressed))
373 if (value.Contains(ControlState.Pressed))
375 newControlState += ControlState.Pressed;
379 newControlState -= ControlState.Pressed;
383 if (allowed.Contains(ControlState.Focused))
385 if (value.Contains(ControlState.Focused))
387 newControlState += ControlState.Focused;
391 newControlState -= ControlState.Focused;
395 if (allowed.Contains(ControlState.Other))
397 if (value.Contains(ControlState.Other))
399 newControlState += ControlState.Other;
403 newControlState -= ControlState.Other;
407 if (child.ControlState != newControlState)
408 child.ControlState = newControlState;
413 OnControlStateChanged(changeInfo);
415 ControlStateChangedEvent?.Invoke(this, changeInfo);
420 /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
422 /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
423 [EditorBrowsable(EditorBrowsableState.Never)]
424 public bool ExcludeLayouting
428 return (bool)GetValue(ExcludeLayoutingProperty);
432 SetValue(ExcludeLayoutingProperty, value);
433 NotifyPropertyChanged();
437 private bool InternalExcludeLayouting
441 return excludeLayouting;
445 excludeLayouting = value;
446 if (Layout != null && Layout.SetPositionByLayout == value)
448 Layout.SetPositionByLayout = !value;
449 Layout.RequestLayout();
455 /// The StyleName, type string.
456 /// The value indicates DALi style name defined in json theme file.
458 /// <since_tizen> 3 </since_tizen>
459 public string StyleName
463 return (string)GetValue(StyleNameProperty);
467 SetValue(StyleNameProperty, value);
468 NotifyPropertyChanged();
473 /// The KeyInputFocus, type bool.
475 [EditorBrowsable(EditorBrowsableState.Never)]
476 public bool KeyInputFocus
480 return (bool)GetValue(KeyInputFocusProperty);
484 SetValue(KeyInputFocusProperty, value);
485 NotifyPropertyChanged();
490 /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
494 /// The property cascade chaining set is not recommended.
497 /// Animatable - This property can be animated using <c>Animation</c> class.
499 /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
504 /// This way is recommended for setting the property
506 /// var view = new View();
507 /// view.BackgroundColor = new Color(0.5f, 0.1f, 0, 1);
509 /// This way to set the property is prohibited
511 /// view.BackgroundColor.R = 0.5f; //This does not guarantee a proper operation
514 /// <since_tizen> 3 </since_tizen>
515 public Color BackgroundColor
519 return (Color)GetValue(BackgroundColorProperty);
523 SetValue(BackgroundColorProperty, value);
524 NotifyPropertyChanged();
529 /// The mutually exclusive with "backgroundColor" and "background" type Map.
531 /// <since_tizen> 3 </since_tizen>
532 public string BackgroundImage
536 return (string)GetValue(BackgroundImageProperty);
540 SetValue(BackgroundImageProperty, value);
541 NotifyPropertyChanged();
546 /// Get or set the border of background image.
548 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
549 [EditorBrowsable(EditorBrowsableState.Never)]
550 public Rectangle BackgroundImageBorder
554 return (Rectangle)GetValue(BackgroundImageBorderProperty);
558 SetValue(BackgroundImageBorderProperty, value);
559 NotifyPropertyChanged();
564 /// The background of view.
566 /// <since_tizen> 3 </since_tizen>
567 public Tizen.NUI.PropertyMap Background
571 return (PropertyMap)GetValue(BackgroundProperty);
575 SetValue(BackgroundProperty, value);
576 NotifyPropertyChanged();
581 /// Describes a shadow as an image for a View.
582 /// It is null by default.
585 /// Getter returns copied instance of current shadow.
588 /// The mutually exclusive with "BoxShadow".
592 /// Animatable - This property can be animated using <c>Animation</c> class.
593 /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
595 /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
597 /// Animatable sub-property : Offset.
600 [EditorBrowsable(EditorBrowsableState.Never)]
601 public ImageShadow ImageShadow
605 return (ImageShadow)GetValue(ImageShadowProperty);
609 SetValue(ImageShadowProperty, value);
610 NotifyPropertyChanged();
615 /// Describes a box shaped shadow drawing for a View.
616 /// It is null by default.
619 /// The mutually exclusive with "ImageShadow".
623 /// Animatable - This property can be animated using <c>Animation</c> class.
624 /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
626 /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
628 /// Animatable sub-property : Offset, Color, BlurRadius.
631 /// <since_tizen> 9 </since_tizen>
632 public Shadow BoxShadow
636 return (Shadow)GetValue(BoxShadowProperty);
640 SetValue(BoxShadowProperty, value);
641 NotifyPropertyChanged();
646 /// The radius for the rounded corners of the View.
647 /// This will rounds background and shadow edges.
648 /// The values in Vector4 are used in clockwise order from top-left to bottom-left : Vector4(top-left-corner, top-right-corner, bottom-right-corner, bottom-left-corner).
649 /// Each radius will clamp internally to the half of smaller of the view's width or height.
650 /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
654 /// Animatable - This property can be animated using <c>Animation</c> class.
656 /// animation.AnimateTo(view, "CornerRadius", new Vector4(10, 10, 10, 10));
660 /// <since_tizen> 9 </since_tizen>
661 public Vector4 CornerRadius
665 return (Vector4)GetValue(CornerRadiusProperty);
669 SetValue(CornerRadiusProperty, value);
670 NotifyPropertyChanged();
675 /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
676 /// It is absolute by default.
677 /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
679 /// <since_tizen> 9 </since_tizen>
680 public VisualTransformPolicyType CornerRadiusPolicy
682 get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
683 set => SetValue(CornerRadiusPolicyProperty, value);
687 /// The width for the borderline of the View.
691 /// Animatable - This property can be animated using <c>Animation</c> class.
693 /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
696 /// Note that, an image background may not have borderline if it uses the Border property.
698 /// <since_tizen> 9 </since_tizen>
699 public float BorderlineWidth
703 return (float)GetValue(BorderlineWidthProperty);
707 SetValue(BorderlineWidthProperty, value);
708 NotifyPropertyChanged();
713 /// The color for the borderline of the View.
714 /// It is Color.Black by default.
718 /// Animatable - This property can be animated using <c>Animation</c> class.
720 /// animation.AnimateTo(view, "BorderlineColor", new Color(r, g, b, a));
724 /// <since_tizen> 9 </since_tizen>
725 public Color BorderlineColor
729 return (Color)GetValue(BorderlineColorProperty);
733 SetValue(BorderlineColorProperty, value);
734 NotifyPropertyChanged();
739 /// The color selector for the borderline of the View.
740 /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
741 /// So this API is internally used only.
743 internal Selector<Color> BorderlineColorSelector
747 return (Selector<Color>)GetValue(BorderlineColorSelectorProperty);
751 SetValue(BorderlineColorSelectorProperty, value);
752 NotifyPropertyChanged();
757 /// The Relative offset for the borderline of the View.
758 /// Recommended range : [-1.0f to 1.0f].
759 /// If -1.0f, draw borderline inside of the View.
760 /// If 1.0f, draw borderline outside of the View.
761 /// If 0.0f, draw borderline half inside and half outside.
762 /// It is 0.0f by default.
766 /// Animatable - This property can be animated using <c>Animation</c> class.
768 /// animation.AnimateTo(view, "BorderlineOffset", -1.0f);
772 /// <since_tizen> 9 </since_tizen>
773 public float BorderlineOffset
777 return (float)GetValue(BorderlineOffsetProperty);
781 SetValue(BorderlineOffsetProperty, value);
782 NotifyPropertyChanged();
787 /// The current state of the view.
789 /// <since_tizen> 3 </since_tizen>
794 return (States)GetValue(StateProperty);
798 SetValue(StateProperty, value);
799 NotifyPropertyChanged();
804 /// The current sub state of the view.
806 /// <since_tizen> 3 </since_tizen>
807 public States SubState
811 return (States)GetValue(SubStateProperty);
815 SetValue(SubStateProperty, value);
816 NotifyPropertyChanged();
821 /// Displays a tooltip
823 /// <since_tizen> 3 </since_tizen>
824 public Tizen.NUI.PropertyMap Tooltip
828 return (PropertyMap)GetValue(TooltipProperty);
832 SetValue(TooltipProperty, value);
833 NotifyPropertyChanged();
838 /// Displays a tooltip as a text.
840 /// <since_tizen> 3 </since_tizen>
841 public string TooltipText
845 return GetValue(TooltipTextProperty) as string;
849 SetValue(TooltipTextProperty, value);
853 private string InternalTooltipText
857 using (var propertyValue = GetProperty(Property.TOOLTIP))
859 using var propertyMap = new PropertyMap();
860 if (propertyValue != null && propertyValue.Get(propertyMap))
862 using var retrivedContentValue = propertyMap?.Find(NDalic.TooltipContent);
863 if (retrivedContentValue != null)
865 using var contextPropertyMap = new PropertyMap();
866 if (retrivedContentValue.Get(contextPropertyMap))
868 using var retrivedTextValue = contextPropertyMap?.Find(NDalic.TextVisualText);
869 if (retrivedTextValue != null && retrivedTextValue.Get(out string retrivedValue))
871 return retrivedValue;
881 var temp = new Tizen.NUI.PropertyValue(value);
882 SetProperty(View.Property.TOOLTIP, temp);
884 NotifyPropertyChanged();
889 /// The Child property of FlexContainer.<br />
890 /// The proportion of the free space in the container, the flex item will receive.<br />
891 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
893 /// <since_tizen> 3 </since_tizen>
894 [Obsolete("Deprecated in API8, will be removed in API10.")]
899 return (float)GetValue(FlexProperty);
903 SetValue(FlexProperty, value);
904 NotifyPropertyChanged();
909 /// The Child property of FlexContainer.<br />
910 /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
912 /// <since_tizen> 3 </since_tizen>
913 [Obsolete("Deprecated in API8, will be removed in API10.")]
918 return (int)GetValue(AlignSelfProperty);
922 SetValue(AlignSelfProperty, value);
923 NotifyPropertyChanged();
928 /// The Child property of FlexContainer.<br />
929 /// The space around the flex item.<br />
932 /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
934 /// <since_tizen> 3 </since_tizen>
935 [Obsolete("Deprecated in API8, will be removed in API10.")]
936 public Vector4 FlexMargin
940 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
941 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
945 SetValue(FlexMarginProperty, value);
946 NotifyPropertyChanged();
951 /// The top-left cell this child occupies, if not set, the first available cell is used.
954 /// The property cascade chaining set is not recommended.
955 /// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
958 /// This way is recommended for setting the property
960 /// var view = new View();
961 /// view.CellIndex = new Vector2(1, 3);
963 /// This way to set the property is prohibited
965 /// view.CellIndex.X = 1; //This does not guarantee a proper operation
968 /// <since_tizen> 3 </since_tizen>
969 public Vector2 CellIndex
973 return (Vector2)GetValue(CellIndexProperty);
977 SetValue(CellIndexProperty, value);
978 NotifyPropertyChanged();
983 /// The number of rows this child occupies, if not set, the default value is 1.
986 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
988 /// <since_tizen> 3 </since_tizen>
993 return (float)GetValue(RowSpanProperty);
997 SetValue(RowSpanProperty, value);
998 NotifyPropertyChanged();
1003 /// The number of columns this child occupies, if not set, the default value is 1.
1006 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1008 /// <since_tizen> 3 </since_tizen>
1009 public float ColumnSpan
1013 return (float)GetValue(ColumnSpanProperty);
1017 SetValue(ColumnSpanProperty, value);
1018 NotifyPropertyChanged();
1023 /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
1026 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1028 /// <since_tizen> 3 </since_tizen>
1029 public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
1033 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
1037 SetValue(CellHorizontalAlignmentProperty, value);
1038 NotifyPropertyChanged();
1043 /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
1046 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1048 /// <since_tizen> 3 </since_tizen>
1049 public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
1053 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
1057 SetValue(CellVerticalAlignmentProperty, value);
1058 NotifyPropertyChanged();
1063 /// The left focusable view.<br />
1064 /// This will return null if not set.<br />
1065 /// This will also return null if the specified left focusable view is not on a window.<br />
1067 /// <since_tizen> 3 </since_tizen>
1068 public View LeftFocusableView
1070 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1073 return (View)GetValue(LeftFocusableViewProperty);
1077 SetValue(LeftFocusableViewProperty, value);
1078 NotifyPropertyChanged();
1083 /// The right focusable view.<br />
1084 /// This will return null if not set.<br />
1085 /// This will also return null if the specified right focusable view is not on a window.<br />
1087 /// <since_tizen> 3 </since_tizen>
1088 public View RightFocusableView
1090 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1093 return (View)GetValue(RightFocusableViewProperty);
1097 SetValue(RightFocusableViewProperty, value);
1098 NotifyPropertyChanged();
1103 /// The up focusable view.<br />
1104 /// This will return null if not set.<br />
1105 /// This will also return null if the specified up focusable view is not on a window.<br />
1107 /// <since_tizen> 3 </since_tizen>
1108 public View UpFocusableView
1110 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1113 return (View)GetValue(UpFocusableViewProperty);
1117 SetValue(UpFocusableViewProperty, value);
1118 NotifyPropertyChanged();
1123 /// The down focusable view.<br />
1124 /// This will return null if not set.<br />
1125 /// This will also return null if the specified down focusable view is not on a window.<br />
1127 /// <since_tizen> 3 </since_tizen>
1128 public View DownFocusableView
1130 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1133 return (View)GetValue(DownFocusableViewProperty);
1137 SetValue(DownFocusableViewProperty, value);
1138 NotifyPropertyChanged();
1143 /// The clockwise focusable view by rotary wheel.<br />
1144 /// This will return null if not set.<br />
1145 /// This will also return null if the specified clockwise focusable view is not on a window.<br />
1147 [EditorBrowsable(EditorBrowsableState.Never)]
1148 public View ClockwiseFocusableView
1150 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1153 return (View)GetValue(ClockwiseFocusableViewProperty);
1157 SetValue(ClockwiseFocusableViewProperty, value);
1158 NotifyPropertyChanged();
1163 /// The counter clockwise focusable view by rotary wheel.<br />
1164 /// This will return null if not set.<br />
1165 /// This will also return null if the specified counter clockwise focusable view is not on a window.<br />
1167 [EditorBrowsable(EditorBrowsableState.Never)]
1168 public View CounterClockwiseFocusableView
1170 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1173 return (View)GetValue(CounterClockwiseFocusableViewProperty);
1177 SetValue(CounterClockwiseFocusableViewProperty, value);
1178 NotifyPropertyChanged();
1183 /// Whether the view should be focusable by keyboard navigation.
1185 /// <since_tizen> 3 </since_tizen>
1186 public bool Focusable
1190 SetValue(FocusableProperty, value);
1191 NotifyPropertyChanged();
1195 return (bool)GetValue(FocusableProperty);
1200 /// Whether the children of this view can be focusable by keyboard navigation. If user sets this to false, the children of this actor view will not be focused.
1201 /// Note : Default value is true.
1203 [EditorBrowsable(EditorBrowsableState.Never)]
1204 public bool FocusableChildren
1208 SetValue(FocusableChildrenProperty, value);
1209 NotifyPropertyChanged();
1213 return (bool)GetValue(FocusableChildrenProperty);
1218 /// Whether this view can focus by touch.
1219 /// If Focusable is false, FocusableInTouch is disabled.
1220 /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
1222 [EditorBrowsable(EditorBrowsableState.Never)]
1223 public bool FocusableInTouch
1227 SetValue(FocusableInTouchProperty, value);
1228 NotifyPropertyChanged();
1232 return (bool)GetValue(FocusableInTouchProperty);
1237 /// Retrieves the position of the view.
1238 /// The coordinates are relative to the view's parent.
1241 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1242 /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
1243 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1244 /// and users can get the current actual values through them.
1246 /// <since_tizen> 3 </since_tizen>
1247 public Position CurrentPosition
1251 return GetCurrentPosition();
1256 /// Sets the size of a view for the width and the height.<br />
1257 /// Geometry can be scaled to fit within this area.<br />
1258 /// This does not interfere with the view's scale factor.<br />
1259 /// The views default depth is the minimum of width and height.<br />
1262 /// The property cascade chaining set is not recommended.
1265 /// This way is recommended for setting the property
1267 /// var view = new View();
1268 /// view.Size2D = new Size2D(100, 200);
1270 /// This way to set the property is prohibited
1272 /// view.Size2D.Width = 100; //This does not guarantee a proper operation
1275 /// <since_tizen> 3 </since_tizen>
1276 public Size2D Size2D
1280 var temp = (Size2D)GetValue(Size2DProperty);
1282 if (this.Layout == null)
1284 if (temp.Width < 0) { temp.Width = 0; }
1285 if (temp.Height < 0) { temp.Height = 0; }
1292 SetValue(Size2DProperty, value);
1294 NotifyPropertyChanged();
1299 /// Retrieves the size of the view.
1300 /// The coordinates are relative to the view's parent.
1303 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1304 /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
1305 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1306 /// and users can get the current actual values through them.
1308 /// <since_tizen> 3 </since_tizen>
1309 public Size2D CurrentSize
1313 return GetCurrentSize();
1318 /// Retrieves and sets the view's opacity.<br />
1322 /// Animatable - This property can be animated using <c>Animation</c> class.
1324 /// animation.AnimateTo(view, "Opacity", 0.5f);
1328 /// <since_tizen> 3 </since_tizen>
1329 public float Opacity
1333 return (float)GetValue(OpacityProperty);
1337 SetValue(OpacityProperty, value);
1338 NotifyPropertyChanged();
1343 /// Sets the position of the view for X and Y.<br />
1344 /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1345 /// If the position inheritance is disabled, sets the world position.<br />
1348 /// The property cascade chaining set is not recommended.
1351 /// This way is recommended for setting the property
1353 /// var view = new View();
1354 /// view.Position2D = new Position2D(100, 200);
1356 /// This way to set the property is prohibited
1358 /// view.Position2D.X = 100; //This does not guarantee a proper operation
1361 /// <since_tizen> 3 </since_tizen>
1362 public Position2D Position2D
1366 return (Position2D)GetValue(Position2DProperty);
1370 SetValue(Position2DProperty, value);
1371 NotifyPropertyChanged();
1376 /// Retrieves the screen position of the view.<br />
1378 /// <since_tizen> 3 </since_tizen>
1379 public Vector2 ScreenPosition
1383 return GetCurrentScreenPosition();
1388 /// Retrieves the screen position and size of the view.<br />
1391 /// The float type Rectangle class is not ready yet.
1392 /// Therefore, it transmits data in Vector4 class.
1393 /// This type should later be changed to the appropriate data type.
1395 [EditorBrowsable(EditorBrowsableState.Never)]
1396 public Vector4 ScreenPositionSize
1400 return GetCurrentScreenPositionSize();
1405 /// Determines whether the pivot point should be used to determine the position of the view.
1406 /// This is false by default.
1408 /// <remarks>If false, then the top-left of the view is used for the position.
1409 /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1411 /// <since_tizen> 3 </since_tizen>
1412 public bool PositionUsesPivotPoint
1416 return (bool)GetValue(PositionUsesPivotPointProperty);
1420 SetValue(PositionUsesPivotPointProperty, value);
1421 NotifyPropertyChanged();
1426 /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead.
1428 /// <since_tizen> 3 </since_tizen>
1429 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PositionUsesPivotPoint instead. " +
1431 "View view = new View(); " +
1432 "view.PivotPoint = PivotPoint.Center; " +
1433 "view.PositionUsesPivotPoint = true;" +
1434 " This has been deprecated in API5 and will be removed in API8")]
1435 [EditorBrowsable(EditorBrowsableState.Never)]
1436 public bool PositionUsesAnchorPoint
1440 return (bool)GetValue(PositionUsesAnchorPointProperty);
1444 SetValue(PositionUsesAnchorPointProperty, value);
1448 private bool InternalPositionUsesAnchorPoint
1452 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint);
1456 Object.InternalSetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint, value);
1457 NotifyPropertyChanged();
1462 /// Queries whether the view is connected to the stage.<br />
1463 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1465 /// <since_tizen> 3 </since_tizen>
1466 public bool IsOnWindow
1475 /// Gets the depth in the hierarchy for the view.
1477 /// <since_tizen> 3 </since_tizen>
1478 public int HierarchyDepth
1482 return GetHierarchyDepth();
1487 /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1490 /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1491 /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1492 /// The values set by this property will likely change.
1494 /// <since_tizen> 3 </since_tizen>
1495 public int SiblingOrder
1499 return (int)GetValue(SiblingOrderProperty);
1503 SetValue(SiblingOrderProperty, value);
1505 Layout?.ChangeLayoutSiblingOrder(value);
1507 NotifyPropertyChanged();
1512 /// Returns the natural size of the view.
1515 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1517 /// <since_tizen> 5 </since_tizen>
1518 public Vector3 NaturalSize
1522 Vector3 ret = GetNaturalSize();
1523 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1529 /// Returns the natural size (Size2D) of the view.
1532 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1534 /// <since_tizen> 4 </since_tizen>
1535 public Size2D NaturalSize2D
1539 Vector3 temp = GetNaturalSize();
1540 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1544 sz = new Size2D((int)temp.Width, (int)temp.Height);
1552 /// Gets or sets the origin of a view within its parent's area.<br />
1553 /// 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 />
1554 /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1555 /// A view's position is the distance between this origin and the view's anchor-point.<br />
1557 /// <pre>The view has been initialized.</pre>
1558 /// <since_tizen> 3 </since_tizen>
1559 public Position ParentOrigin
1563 Position tmp = (Position)GetValue(ParentOriginProperty);
1564 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1568 SetValue(ParentOriginProperty, value);
1569 NotifyPropertyChanged();
1574 /// Gets or sets the anchor-point of a view.<br />
1575 /// 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 />
1576 /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1577 /// A view position is the distance between its parent-origin and this anchor-point.<br />
1578 /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1579 /// <pre>The view has been initialized.</pre>
1582 /// The property cascade chaining set is not recommended.
1585 /// This way is recommended for setting the property
1587 /// var view = new View();
1588 /// view.PivotPoint = PivotPoint.Center;
1590 /// This way to set the property is prohibited
1592 /// view.PivotPoint.X = 0.5f; //This does not guarantee a proper operation
1595 /// <since_tizen> 3 </since_tizen>
1596 public Position PivotPoint
1600 return (Position)GetValue(PivotPointProperty);
1604 SetValue(PivotPointProperty, value);
1605 NotifyPropertyChanged();
1610 /// Gets or sets the size width of the view.
1614 /// Animatable - This property can be animated using <c>Animation</c> class.
1616 /// animation.AnimateTo(view, "SizeWidth", 500.0f);
1620 /// <since_tizen> 3 </since_tizen>
1621 public float SizeWidth
1625 return (float)GetValue(SizeWidthProperty);
1629 SetValue(SizeWidthProperty, value);
1630 NotifyPropertyChanged();
1635 /// Gets or sets the size height of the view.
1639 /// Animatable - This property can be animated using <c>Animation</c> class.
1642 /// animation.AnimateTo(view, "SizeHeight", 500.0f);
1645 /// <since_tizen> 3 </since_tizen>
1646 public float SizeHeight
1650 return (float)GetValue(SizeHeightProperty);
1654 SetValue(SizeHeightProperty, value);
1655 NotifyPropertyChanged();
1660 /// Gets or sets the position of the view.<br />
1661 /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1662 /// If the position inheritance is disabled, sets the world position.<br />
1666 /// Animatable - This property can be animated using <c>Animation</c> class.
1668 /// animation.AnimateTo(view, "Position", new Position(50, 0));
1671 /// The property cascade chaining set is not recommended.
1674 /// This way is recommended for setting the property
1676 /// var view = new View();
1677 /// view.Position = new Position(100, 200.5f, 0);
1679 /// This way to set the property is prohibited
1681 /// view.Position.Y = 200.5f; //This does not guarantee a proper operation
1684 /// <since_tizen> 3 </since_tizen>
1685 public Position Position
1689 return (Position)GetValue(PositionProperty);
1693 SetValue(PositionProperty, value);
1694 NotifyPropertyChanged();
1699 /// Gets or sets the position X of the view.
1703 /// Animatable - This property can be animated using <c>Animation</c> class.
1705 /// animation.AnimateTo(view, "PositionX", 50.0f);
1709 /// <since_tizen> 3 </since_tizen>
1710 public float PositionX
1714 return (float)GetValue(PositionXProperty);
1718 SetValue(PositionXProperty, value);
1719 NotifyPropertyChanged();
1724 /// Gets or sets the position Y of the view.
1728 /// Animatable - This property can be animated using <c>Animation</c> class.
1730 /// animation.AnimateTo(view, "PositionY", 50.0f);
1734 /// <since_tizen> 3 </since_tizen>
1735 public float PositionY
1739 return (float)GetValue(PositionYProperty);
1743 SetValue(PositionYProperty, value);
1744 NotifyPropertyChanged();
1749 /// Gets or sets the position Z of the view.
1753 /// Animatable - This property can be animated using <c>Animation</c> class.
1755 /// animation.AnimateTo(view, "PositionZ", 50.0f);
1759 /// <since_tizen> 3 </since_tizen>
1760 public float PositionZ
1764 return (float)GetValue(PositionZProperty);
1768 SetValue(PositionZProperty, value);
1769 NotifyPropertyChanged();
1774 /// Gets or sets the world position of the view.
1776 /// <since_tizen> 3 </since_tizen>
1777 public Vector3 WorldPosition
1781 return GetCurrentWorldPosition();
1786 /// Gets or sets the orientation of the view.<br />
1787 /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1791 /// This is an asynchronous method.
1794 /// Animatable - This property can be animated using <c>Animation</c> class.
1796 /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
1800 /// <since_tizen> 3 </since_tizen>
1801 public Rotation Orientation
1805 return (Rotation)GetValue(OrientationProperty);
1809 SetValue(OrientationProperty, value);
1810 NotifyPropertyChanged();
1815 /// Gets or sets the world orientation of the view.<br />
1817 /// <since_tizen> 3 </since_tizen>
1818 public Rotation WorldOrientation
1822 Rotation temp = new Rotation();
1823 var pValue = GetProperty(View.Property.WorldOrientation);
1831 /// Gets or sets the scale factor applied to the view.<br />
1835 /// Animatable - This property can be animated using <c>Animation</c> class.
1837 /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
1840 /// The property cascade chaining set is not recommended.
1843 /// This way is recommended for setting the property
1845 /// var view = new View();
1846 /// view.Scale = new Vector3(1.5f, 2.0f, 1.0f);
1848 /// This way to set the property is prohibited
1850 /// view.Scale.Width = 1.5f; //This does not guarantee a proper operation
1853 /// <since_tizen> 3 </since_tizen>
1854 public Vector3 Scale
1858 return (Vector3)GetValue(ScaleProperty);
1862 SetValue(ScaleProperty, value);
1863 NotifyPropertyChanged();
1868 /// Gets or sets the scale X factor applied to the view.
1872 /// Animatable - This property can be animated using <c>Animation</c> class.
1874 /// animation.AnimateTo(view, "ScaleX", 1.5f);
1878 /// <since_tizen> 3 </since_tizen>
1883 return (float)GetValue(ScaleXProperty);
1887 SetValue(ScaleXProperty, value);
1888 NotifyPropertyChanged();
1893 /// Gets or sets the scale Y factor applied to the view.
1897 /// Animatable - This property can be animated using <c>Animation</c> class.
1899 /// animation.AnimateTo(view, "ScaleY", 1.5f);
1903 /// <since_tizen> 3 </since_tizen>
1908 return (float)GetValue(ScaleYProperty);
1912 SetValue(ScaleYProperty, value);
1913 NotifyPropertyChanged();
1918 /// Gets or sets the scale Z factor applied to the view.
1922 /// Animatable - This property can be animated using <c>Animation</c> class.
1924 /// animation.AnimateTo(view, "ScaleZ", 1.5f);
1928 /// <since_tizen> 3 </since_tizen>
1933 return (float)GetValue(ScaleZProperty);
1937 SetValue(ScaleZProperty, value);
1938 NotifyPropertyChanged();
1943 /// Gets the world scale of the view.
1945 /// <since_tizen> 3 </since_tizen>
1946 public Vector3 WorldScale
1950 return GetCurrentWorldScale();
1955 /// Retrieves the visibility flag of the view.
1959 /// If the view is not visible, then the view and its children will not be rendered.
1960 /// 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.
1963 /// Animatable - This property can be animated using <c>Animation</c> class.
1965 /// animation.AnimateTo(view, "Visibility", false);
1969 /// <since_tizen> 3 </since_tizen>
1970 public bool Visibility
1974 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.VISIBLE);
1979 /// Gets the view's world color.
1981 /// <since_tizen> 3 </since_tizen>
1982 public Vector4 WorldColor
1986 return GetCurrentWorldColor();
1991 /// Gets or sets the view's name.
1993 /// <since_tizen> 3 </since_tizen>
1998 return (string)GetValue(NameProperty);
2002 SetValue(NameProperty, value);
2003 NotifyPropertyChanged();
2008 /// Get the number of children held by the view.
2010 /// <since_tizen> 3 </since_tizen>
2011 public new uint ChildCount
2015 return Convert.ToUInt32(Children.Count);
2020 /// Gets the view's ID.
2023 /// <since_tizen> 3 </since_tizen>
2033 /// Gets or sets the status of whether the view should emit touch or hover signals.
2034 /// If a View is made insensitive, then the View and its children are not hittable.
2036 /// <since_tizen> 3 </since_tizen>
2037 public bool Sensitive
2041 return (bool)GetValue(SensitiveProperty);
2045 SetValue(SensitiveProperty, value);
2046 NotifyPropertyChanged();
2051 /// Gets or sets the status of whether the view should be enabled user interactions.
2052 /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled.
2054 /// <since_tizen> tizen_next </since_tizen>
2055 [EditorBrowsable(EditorBrowsableState.Never)]
2056 public bool IsEnabled
2060 return (bool)GetValue(IsEnabledProperty);
2064 SetValue(IsEnabledProperty, value);
2065 NotifyPropertyChanged();
2070 /// 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.
2072 /// <since_tizen> 3 </since_tizen>
2073 public bool LeaveRequired
2077 return (bool)GetValue(LeaveRequiredProperty);
2081 SetValue(LeaveRequiredProperty, value);
2082 NotifyPropertyChanged();
2087 /// Gets or sets the status of whether a child view inherits it's parent's orientation.
2089 /// <since_tizen> 3 </since_tizen>
2090 public bool InheritOrientation
2094 return (bool)GetValue(InheritOrientationProperty);
2098 SetValue(InheritOrientationProperty, value);
2099 NotifyPropertyChanged();
2104 /// Gets or sets the status of whether a child view inherits it's parent's scale.
2106 /// <since_tizen> 3 </since_tizen>
2107 public bool InheritScale
2111 return (bool)GetValue(InheritScaleProperty);
2115 SetValue(InheritScaleProperty, value);
2116 NotifyPropertyChanged();
2121 /// Gets or sets the status of how the view and its children should be drawn.<br />
2122 /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
2123 /// 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 />
2124 /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
2125 /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
2126 /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
2128 /// <since_tizen> 3 </since_tizen>
2129 public DrawModeType DrawMode
2133 return (DrawModeType)GetValue(DrawModeProperty);
2137 SetValue(DrawModeProperty, value);
2138 NotifyPropertyChanged();
2143 /// Gets or sets the relative to parent size factor of the view.<br />
2144 /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
2145 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
2148 /// The property cascade chaining set is not recommended.
2151 /// This way is recommended for setting the property
2153 /// var text = new TextField();
2154 /// text.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
2156 /// This way to set the property is prohibited
2158 /// text.SizeModeFactor.Width = 1.0f; //This does not guarantee a proper operation
2161 /// <since_tizen> 3 </since_tizen>
2162 public Vector3 SizeModeFactor
2166 return (Vector3)GetValue(SizeModeFactorProperty);
2170 SetValue(SizeModeFactorProperty, value);
2171 NotifyPropertyChanged();
2176 /// Gets or sets the width resize policy to be used.
2178 /// <since_tizen> 3 </since_tizen>
2179 public ResizePolicyType WidthResizePolicy
2183 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
2187 SetValue(WidthResizePolicyProperty, value);
2188 NotifyPropertyChanged();
2193 /// Gets or sets the height resize policy to be used.
2195 /// <since_tizen> 3 </since_tizen>
2196 public ResizePolicyType HeightResizePolicy
2200 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
2204 SetValue(HeightResizePolicyProperty, value);
2205 NotifyPropertyChanged();
2210 /// Gets or sets the policy to use when setting size with size negotiation.<br />
2211 /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
2213 /// <since_tizen> 3 </since_tizen>
2214 public SizeScalePolicyType SizeScalePolicy
2218 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
2222 SetValue(SizeScalePolicyProperty, value);
2223 NotifyPropertyChanged();
2228 /// Gets or sets the status of whether the width size is dependent on the height size.
2230 /// <since_tizen> 3 </since_tizen>
2231 public bool WidthForHeight
2235 return (bool)GetValue(WidthForHeightProperty);
2239 SetValue(WidthForHeightProperty, value);
2240 NotifyPropertyChanged();
2245 /// Gets or sets the status of whether the height size is dependent on the width size.
2247 /// <since_tizen> 3 </since_tizen>
2248 public bool HeightForWidth
2252 return (bool)GetValue(HeightForWidthProperty);
2256 SetValue(HeightForWidthProperty, value);
2257 NotifyPropertyChanged();
2262 /// Gets or sets the padding for use in layout.
2265 /// The property cascade chaining set is not recommended.
2268 /// This way is recommended for setting the property
2270 /// var view = new View();
2271 /// view.Padding = new Extents(5, 5, 5, 5);
2273 /// This way to set the property is prohibited
2275 /// view.Padding.Start = 5; //This does not guarantee a proper operation
2278 /// <since_tizen> 5 </since_tizen>
2279 public Extents Padding
2283 return (Extents)GetValue(PaddingProperty);
2287 SetValue(PaddingProperty, value);
2288 NotifyPropertyChanged();
2293 /// Gets or sets the minimum size the view can be assigned in size negotiation.
2295 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2297 /// The property cascade chaining set is not recommended.
2300 /// This way is recommended for setting the property
2302 /// var view = new View();
2303 /// view.MinimumSize = new Size2D(100, 200);
2305 /// This way to set the property is prohibited
2307 /// view.MinimumSize.Width = 100; //This does not guarantee a proper operation
2310 /// <since_tizen> 3 </since_tizen>
2311 public Size2D MinimumSize
2315 return (Size2D)GetValue(MinimumSizeProperty);
2321 throw new ArgumentNullException(nameof(value));
2325 // Note: it only works if minimum size is >= than natural size.
2326 // To force the size it should be done through the width&height spec or Size2D.
2327 layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
2328 layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
2329 layout.RequestLayout();
2331 SetValue(MinimumSizeProperty, value);
2332 NotifyPropertyChanged();
2337 /// Gets or sets the maximum size the view can be assigned in size negotiation.
2340 /// This way is recommended for setting the property
2342 /// var view = new View();
2343 /// view.MaximumSize = new Size2D(100, 200);
2345 /// This way to set the property is prohibited
2347 /// view.MaximumSize.Height = 200; //This does not guarantee a proper operation
2350 /// <since_tizen> 3 </since_tizen>
2351 public Size2D MaximumSize
2355 return (Size2D)GetValue(MaximumSizeProperty);
2359 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
2360 // MATCH_PARENT spec + parent container size can be used to limit
2363 layout.RequestLayout();
2365 SetValue(MaximumSizeProperty, value);
2366 NotifyPropertyChanged();
2371 /// Gets or sets whether a child view inherits it's parent's position.<br />
2372 /// Default is to inherit.<br />
2373 /// 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 />
2375 /// <since_tizen> 3 </since_tizen>
2376 public bool InheritPosition
2380 return (bool)GetValue(InheritPositionProperty);
2384 SetValue(InheritPositionProperty, value);
2385 NotifyPropertyChanged();
2390 /// Gets or sets the clipping behavior (mode) of it's children.
2392 /// <since_tizen> 3 </since_tizen>
2393 public ClippingModeType ClippingMode
2397 return (ClippingModeType)GetValue(ClippingModeProperty);
2401 SetValue(ClippingModeProperty, value);
2402 NotifyPropertyChanged();
2407 /// Gets the number of renderers held by the view.
2409 /// <since_tizen> 3 </since_tizen>
2410 public uint RendererCount
2414 return GetRendererCount();
2419 /// This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead.
2422 /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2424 /// <since_tizen> 3 </since_tizen>
2425 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead. " +
2427 "View view = new View(); " +
2428 "view.PivotPoint = PivotPoint.Center; " +
2429 "view.PositionUsesPivotPoint = true;")]
2430 [EditorBrowsable(EditorBrowsableState.Never)]
2431 public Position AnchorPoint
2435 return GetValue(AnchorPointProperty) as Position;
2439 SetValue(AnchorPointProperty, value);
2443 private Position InternalAnchorPoint
2447 return GetCurrentAnchorPoint();
2451 SetAnchorPoint(value);
2452 NotifyPropertyChanged();
2457 /// Sets the size of a view for the width, the height and the depth.<br />
2458 /// Geometry can be scaled to fit within this area.<br />
2459 /// This does not interfere with the view's scale factor.<br />
2460 /// The views default depth is the minimum of width and height.<br />
2464 /// Animatable - This property can be animated using <c>Animation</c> class.
2466 /// animation.AnimateTo(view, "Size", new Size(100, 100));
2469 /// The property cascade chaining set is not recommended.
2472 /// This way is recommended for setting the property
2474 /// var view = new View();
2475 /// view.Size = new Size(100.5f, 200, 0);
2477 /// This way to set the property is prohibited
2479 /// view.Size.Width = 100.5f; //This does not guarantee a proper operation
2482 /// <since_tizen> 5 </since_tizen>
2487 return (Size)GetValue(SizeProperty);
2491 SetValue(SizeProperty, value);
2492 NotifyPropertyChanged();
2497 /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead.
2499 /// <since_tizen> 3 </since_tizen>
2500 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. " +
2502 "Container parent = view.GetParent(); " +
2503 "View view = parent as View;")]
2504 [EditorBrowsable(EditorBrowsableState.Never)]
2505 public new View Parent
2510 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2511 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2512 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2514 if (basehandle is Layer layer)
2516 ret = new View(Layer.getCPtr(layer).Handle, false);
2517 NUILog.Error("This Parent property is deprecated, should do not be used");
2521 ret = basehandle as View;
2524 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2525 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2527 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2533 /// Gets/Sets whether inherit parent's the layout Direction.
2535 /// <since_tizen> 4 </since_tizen>
2536 public bool InheritLayoutDirection
2540 return (bool)GetValue(InheritLayoutDirectionProperty);
2544 SetValue(InheritLayoutDirectionProperty, value);
2545 NotifyPropertyChanged();
2550 /// Gets/Sets the layout Direction.
2552 /// <since_tizen> 4 </since_tizen>
2553 public ViewLayoutDirectionType LayoutDirection
2557 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2561 SetValue(LayoutDirectionProperty, value);
2562 NotifyPropertyChanged();
2563 layout?.RequestLayout();
2568 /// Gets or sets the Margin for use in layout.
2571 /// Margin property is supported by Layout algorithms and containers.
2572 /// Please Set Layout if you want to use Margin property.
2573 /// The property cascade chaining set is not recommended.
2576 /// This way is recommended for setting the property
2578 /// var view = new View();
2579 /// view.Margin = new Extents(10, 5, 15, 20);
2581 /// This way to set the property is prohibited
2583 /// view.Margin.Top = 15; //This does not guarantee a proper operation
2586 /// <since_tizen> 4 </since_tizen>
2587 public Extents Margin
2591 return (Extents)GetValue(MarginProperty);
2595 SetValue(MarginProperty, value);
2596 NotifyPropertyChanged();
2601 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2605 /// // matchParentView matches its size to its parent size.
2606 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2607 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2609 /// // wrapContentView wraps its children with their desired size.
2610 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2611 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2613 /// // exactSizeView shows itself with an exact size.
2614 /// exactSizeView.WidthSpecification = 100;
2615 /// exactSizeView.HeightSpecification = 100;
2618 /// <since_tizen> 6 </since_tizen>
2619 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2620 public int WidthSpecification
2624 return (int)GetValue(WidthSpecificationProperty);
2628 SetValue(WidthSpecificationProperty, value);
2629 NotifyPropertyChanged();
2633 private int InternalWidthSpecification
2641 if (value == widthPolicy)
2644 widthPolicy = value;
2645 if (widthPolicy >= 0)
2647 SizeWidth = widthPolicy;
2649 layout?.RequestLayout();
2654 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2658 /// // matchParentView matches its size to its parent size.
2659 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2660 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2662 /// // wrapContentView wraps its children with their desired size.
2663 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2664 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2666 /// // exactSizeView shows itself with an exact size.
2667 /// exactSizeView.WidthSpecification = 100;
2668 /// exactSizeView.HeightSpecification = 100;
2671 /// <since_tizen> 6 </since_tizen>
2672 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2673 public int HeightSpecification
2677 return (int)GetValue(HeightSpecificationProperty);
2681 SetValue(HeightSpecificationProperty, value);
2682 NotifyPropertyChanged();
2686 private int InternalHeightSpecification
2690 return heightPolicy;
2694 if (value == heightPolicy)
2697 heightPolicy = value;
2698 if (heightPolicy >= 0)
2700 SizeHeight = heightPolicy;
2702 layout?.RequestLayout();
2707 /// Gets the List of transitions for this View.
2709 /// <since_tizen> 6 </since_tizen>
2710 public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2714 if (layoutTransitions == null)
2716 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2718 return layoutTransitions;
2723 /// Sets a layout transitions for this View.
2725 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2727 /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2729 /// <since_tizen> 6 </since_tizen>
2730 public LayoutTransition LayoutTransition
2734 return GetValue(LayoutTransitionProperty) as LayoutTransition;
2738 SetValue(LayoutTransitionProperty, value);
2739 NotifyPropertyChanged();
2743 private LayoutTransition InternalLayoutTransition
2747 return layoutTransition;
2753 throw new global::System.ArgumentNullException(nameof(value));
2755 if (layoutTransitions == null)
2757 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2760 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
2762 AttachTransitionsToChildren(value);
2764 layoutTransition = value;
2769 /// This has been deprecated in API5 and will be removed in API8. Use Padding instead.
2772 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2774 /// <since_tizen> 4 </since_tizen>
2775 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use Padding instead.")]
2776 [EditorBrowsable(EditorBrowsableState.Never)]
2777 public Extents PaddingEX
2781 return GetValue(PaddingEXProperty) as Extents;
2785 SetValue(PaddingEXProperty, value);
2789 private Extents InternalPaddingEX
2793 Extents temp = new Extents(0, 0, 0, 0);
2794 var pValue = GetProperty(View.Property.PADDING);
2797 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2803 var temp = new Tizen.NUI.PropertyValue(value);
2804 SetProperty(View.Property.PADDING, temp);
2806 NotifyPropertyChanged();
2807 layout?.RequestLayout();
2812 /// The Color of View. This is an RGBA value.
2813 /// Each RGBA components match as <see cref="ColorRed"/>, <see cref="ColorGreen"/>, <see cref="ColorBlue"/>, and <see cref="Opacity"/>.
2814 /// This property will multiply the final color of this view. (BackgroundColor, BorderlineColor, BackgroundImage, etc).
2815 /// For example, if view.BackgroundColor = Color.Yellow and view.Color = Color.Purple, this view will shown as Red.
2816 /// Inherient of color value depend on <see cref="ColorMode"/>.
2820 /// Animatable - This property can be animated using <c>Animation</c> class.
2822 /// The property cascade chaining set is not recommended.
2825 /// This way is recommended for setting the property
2827 /// var view = new View();
2828 /// view.Color = new Color(0.5f, 0.2f, 0.1f, 0.5f);
2830 /// This way to set the property is prohibited
2832 /// view.Color.A = 0.5f; //This does not guarantee a proper operation
2835 [EditorBrowsable(EditorBrowsableState.Never)]
2840 return (Color)GetValue(ColorProperty);
2844 SetValue(ColorProperty, value);
2845 NotifyPropertyChanged();
2850 /// The Red component of View.Color.
2854 /// Animatable - This property can be animated using <c>Animation</c> class.
2857 [EditorBrowsable(EditorBrowsableState.Never)]
2858 public float ColorRed
2862 return (float)GetValue(ColorRedProperty);
2866 SetValue(ColorRedProperty, value);
2867 NotifyPropertyChanged();
2872 /// The Green component of View.Color.
2876 /// Animatable - This property can be animated using <c>Animation</c> class.
2879 [EditorBrowsable(EditorBrowsableState.Never)]
2880 public float ColorGreen
2884 return (float)GetValue(ColorGreenProperty);
2888 SetValue(ColorGreenProperty, value);
2889 NotifyPropertyChanged();
2894 /// The Blue component of View.Color.
2898 /// Animatable - This property can be animated using <c>Animation</c> class.
2901 [EditorBrowsable(EditorBrowsableState.Never)]
2902 public float ColorBlue
2906 return (float)GetValue(ColorBlueProperty);
2910 SetValue(ColorBlueProperty, value);
2911 NotifyPropertyChanged();
2916 /// Set the layout on this View. Replaces any existing Layout.
2919 /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
2921 /// <since_tizen> 6 </since_tizen>
2922 public LayoutItem Layout
2926 return GetValue(LayoutProperty) as LayoutItem;
2930 SetValue(LayoutProperty, value);
2934 private LayoutItem InternalLayout
2942 // Do nothing if layout provided is already set on this View.
2943 if (value == layout)
2948 LayoutingDisabled = false;
2951 // If new layout being set already has a owner then that owner receives a replacement default layout.
2952 // First check if the layout to be set already has a owner.
2953 if (value?.Owner != null)
2955 // Previous owner of the layout gets a default layout as a replacement.
2956 value.Owner.Layout = new AbsoluteLayout()
2958 // Copy Margin and Padding to replacement LayoutGroup.
2959 Margin = value.Margin,
2960 Padding = value.Padding,
2964 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2965 // View if no replacement. Previously margin and padding values would have been moved from
2966 // the View to the layout.
2967 if (layout != null) // Existing layout
2971 // Existing layout being replaced so copy over margin and padding values.
2972 value.Margin = layout.Margin;
2973 value.Padding = layout.Padding;
2974 value.SetPositionByLayout = !excludeLayouting;
2978 // Layout not being replaced so restore margin and padding to View.
2979 SetValue(MarginProperty, layout.Margin);
2980 SetValue(PaddingProperty, layout.Padding);
2981 NotifyPropertyChanged();
2986 // First Layout to be added to the View hence copy
2988 // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2991 Extents margin = Margin;
2992 Extents padding = Padding;
2993 bool setMargin = false;
2994 bool setPadding = false;
2996 if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
2998 // If View already has a margin set then store it in Layout instead.
2999 value.Margin = margin;
3000 SetValue(MarginProperty, new Extents(0, 0, 0, 0));
3004 if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
3006 // If View already has a padding set then store it in Layout instead.
3007 value.Padding = padding;
3008 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
3012 if (setMargin || setPadding)
3014 NotifyPropertyChanged();
3017 value.SetPositionByLayout = !excludeLayouting;
3021 // Remove existing layout from it's parent layout group.
3024 // Set layout to this view
3030 /// The weight of the View, used to share available space in a layout with siblings.
3032 /// <since_tizen> 6 </since_tizen>
3042 layout?.RequestLayout();
3047 /// Whether to load the BackgroundImage synchronously.
3048 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3049 /// Note: For Normal Quad images only.
3051 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
3052 [EditorBrowsable(EditorBrowsableState.Never)]
3053 public bool BackgroundImageSynchronosLoading
3057 return (bool)GetValue(BackgroundImageSynchronosLoadingProperty);
3061 SetValue(BackgroundImageSynchronosLoadingProperty, value);
3062 NotifyPropertyChanged();
3066 private bool InternalBackgroundImageSynchronosLoading
3070 return BackgroundImageSynchronousLoading;
3074 BackgroundImageSynchronousLoading = value;
3079 /// Whether to load the BackgroundImage synchronously.
3080 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3081 /// Note: For Normal Quad images only.
3083 /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3084 [EditorBrowsable(EditorBrowsableState.Never)]
3085 public bool BackgroundImageSynchronousLoading
3089 return (bool)GetValue(BackgroundImageSynchronousLoadingProperty);
3093 SetValue(BackgroundImageSynchronousLoadingProperty, value);
3094 NotifyPropertyChanged();
3098 private bool InternalBackgroundImageSynchronousLoading
3102 return backgroundImageSynchronousLoading;
3106 backgroundImageSynchronousLoading = value;
3108 if (!string.IsNullOrEmpty(BackgroundImage))
3110 PropertyMap bgMap = this.Background;
3111 var temp = new PropertyValue(backgroundImageSynchronousLoading);
3112 bgMap[ImageVisualProperty.SynchronousLoading] = temp;
3119 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3120 [EditorBrowsable(EditorBrowsableState.Never)]
3121 public Vector4 UpdateAreaHint
3125 return (Vector4)GetValue(UpdateAreaHintProperty);
3129 SetValue(UpdateAreaHintProperty, value);
3130 NotifyPropertyChanged();
3135 /// Enable/Disable ControlState propagation for children.
3136 /// It is false by default.
3137 /// If the View needs to share ControlState with descendants, please set it true.
3138 /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
3140 [EditorBrowsable(EditorBrowsableState.Never)]
3141 public bool EnableControlStatePropagation
3145 return (bool)GetValue(EnableControlStatePropagationProperty);
3149 SetValue(EnableControlStatePropagationProperty, value);
3150 NotifyPropertyChanged();
3154 private bool InternalEnableControlStatePropagation
3156 get => themeData?.ControlStatePropagation ?? false;
3159 if (InternalEnableControlStatePropagation == value) return;
3161 if (themeData == null) themeData = new ThemeData();
3163 themeData.ControlStatePropagation = value;
3165 foreach (View child in Children)
3167 child.EnableControlStatePropagation = value;
3173 /// The ControlStates can propagate from the parent.
3174 /// Listed ControlStates will be accepted propagation of the parent ControlState changes
3175 /// if parent view EnableControlState is true.
3176 /// <see cref="EnableControlState"/>.
3177 /// Default is ControlState.All, so every ControlStates will be propagated from the parent.
3179 [EditorBrowsable(EditorBrowsableState.Never)]
3180 public ControlState PropagatableControlStates
3184 return (ControlState)GetValue(PropagatableControlStatesProperty);
3188 SetValue(PropagatableControlStatesProperty, value);
3189 NotifyPropertyChanged();
3193 private ControlState InternalPropagatableControlStates
3195 get => propagatableControlStates;
3196 set => propagatableControlStates = value;
3200 /// By default, it is false in View, true in Control.
3201 /// Note that if the value is true, the View will be a touch receptor.
3203 [EditorBrowsable(EditorBrowsableState.Never)]
3204 public bool EnableControlState
3208 return (bool)GetValue(EnableControlStateProperty);
3212 SetValue(EnableControlStateProperty, value);
3217 /// Whether the actor grab all touches even if touch leaves its boundary.
3219 /// <returns>true, if it grab all touch after start</returns>
3220 [EditorBrowsable(EditorBrowsableState.Never)]
3221 public bool GrabTouchAfterLeave
3225 return (bool)GetValue(GrabTouchAfterLeaveProperty);
3229 SetValue(GrabTouchAfterLeaveProperty, value);
3233 private bool InternalGrabTouchAfterLeave
3237 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart);
3241 Object.InternalSetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart, value);
3243 // Use custom HitTest callback only if GrabTouchAfterLeave is true.
3246 RegisterHitTestCallback();
3250 UnregisterHitTestCallback();
3253 NotifyPropertyChanged();
3258 /// Whether the view will only receive own touch.
3260 /// <returns>true, if it only receives touches that started from itself.</returns>
3261 [EditorBrowsable(EditorBrowsableState.Never)]
3262 public bool AllowOnlyOwnTouch
3266 return (bool)GetValue(AllowOnlyOwnTouchProperty);
3270 SetValue(AllowOnlyOwnTouchProperty, value);
3274 private bool InternalAllowOnlyOwnTouch
3278 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch);
3282 Object.InternalSetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch, value);
3283 NotifyPropertyChanged();
3288 /// Determines which blend equation will be used to render renderers of this actor.
3290 /// <returns>blend equation enum currently assigned</returns>
3291 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
3292 [EditorBrowsable(EditorBrowsableState.Never)]
3293 public BlendEquationType BlendEquation
3297 return (BlendEquationType)GetValue(BlendEquationProperty);
3301 SetValue(BlendEquationProperty, value);
3305 private BlendEquationType InternalBlendEquation
3309 return (BlendEquationType)Object.InternalGetPropertyInt(SwigCPtr, View.Property.BlendEquation);
3313 Object.InternalSetPropertyInt(SwigCPtr, View.Property.BlendEquation, (int)value);
3314 NotifyPropertyChanged();
3319 /// If the value is true, the View will change its style as the theme changes.
3320 /// The default value is false in normal case but it can be true when the NUIApplication is created with <see cref="NUIApplication.ThemeOptions.ThemeChangeSensitive"/>.
3322 /// <since_tizen> 9 </since_tizen>
3323 public bool ThemeChangeSensitive
3325 get => (bool)GetValue(ThemeChangeSensitiveProperty);
3326 set => SetValue(ThemeChangeSensitiveProperty, value);
3330 /// Create Style, it is abstract function and must be override.
3332 [EditorBrowsable(EditorBrowsableState.Never)]
3333 protected virtual ViewStyle CreateViewStyle()
3335 return new ViewStyle();
3339 /// Called after the View's ControlStates changed.
3341 /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
3342 [EditorBrowsable(EditorBrowsableState.Never)]
3343 protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
3349 [EditorBrowsable(EditorBrowsableState.Never)]
3350 protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
3352 isThemeChanged = true;
3353 if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
3354 else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
3355 isThemeChanged = false;
3359 /// Apply style instance to the view.
3360 /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
3362 /// <since_tizen> 9 </since_tizen>
3363 public virtual void ApplyStyle(ViewStyle viewStyle)
3365 if (viewStyle == null || themeData?.viewStyle == viewStyle) return;
3367 if (themeData == null) themeData = new ThemeData();
3369 themeData.viewStyle = viewStyle;
3371 if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
3377 BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
3379 if (bindablePropertyOfView == null)
3384 var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
3385 viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
3387 foreach (var sourceProperty in dirtyStyleProperties)
3389 var sourceValue = viewStyle.GetValue(sourceProperty);
3391 if (sourceValue == null)
3396 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
3398 // Do not set value again when theme is changed and the value has been set already.
3399 if (isThemeChanged && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty))
3404 if (destinationProperty != null)
3406 InternalSetValue(destinationProperty, sourceValue);
3412 /// Get whether the View is culled or not.
3413 /// True means that the View is out of the view frustum.
3416 /// Hidden-API (Inhouse-API).
3418 [EditorBrowsable(EditorBrowsableState.Never)]
3423 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.Culled);
3428 /// Set or Get TransitionOptions for the page transition.
3429 /// This property is used to define how this view will be transitioned during Page switching.
3431 /// <since_tizen> 9 </since_tizen>
3432 public TransitionOptions TransitionOptions
3436 return GetValue(TransitionOptionsProperty) as TransitionOptions;
3440 SetValue(TransitionOptionsProperty, value);
3441 NotifyPropertyChanged();
3445 private TransitionOptions InternalTransitionOptions
3449 transitionOptions = value;
3453 return transitionOptions;
3458 /// Called when the view is hit through TouchEvent or GestureEvent.
3459 /// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
3460 /// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
3461 /// User can override whether hit or not in HitTest.
3462 /// You can get the coordinates relative to tthe top-left of the hit view by touch.GetLocalPosition(0).
3463 /// or you can get the coordinates relative to the top-left of the screen by touch.GetScreenPosition(0).
3465 // <param name="touch"><see cref="Tizen.NUI.Touch"/>The touch data</param>
3466 [EditorBrowsable(EditorBrowsableState.Never)]
3467 protected virtual bool HitTest(Touch touch)
3473 /// Retrieve the View's current Color.
3476 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3477 /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
3478 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3479 /// and users can get the current actual values through them.
3481 [EditorBrowsable(EditorBrowsableState.Never)]
3482 public Color CurrentColor => GetCurrentColor();
3485 /// Retrieve the current scale factor applied to the View.
3488 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3489 /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
3490 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3491 /// and users can get the current actual values through them.
3493 [EditorBrowsable(EditorBrowsableState.Never)]
3494 public Vector3 CurrentScale => GetCurrentScale();