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();
108 static internal new void Preload()
112 // Do nothing. Just call for load static values.
113 var temporalPositionPropertyGroup = positionPropertyGroup;
114 var temporalSizePropertyGroup = sizePropertyGroup;
115 var temporalScalePropertyGroup = scalePropertyGroup;
119 /// Accessibility mode for controlling View's Accessible implementation.
120 /// It is only relevant when deriving custom controls from View directly,
121 /// as classes derived from CustomView (or any of its subclasses) get the
122 /// Custom mode by default.
124 [EditorBrowsable(EditorBrowsableState.Never)]
125 public enum ViewAccessibilityMode
128 /// Default accessibility implementation. Overriding View.Accessibility...()
129 /// virtual methods will have no effect.
131 [EditorBrowsable(EditorBrowsableState.Never)]
134 /// Custom accessibility implementation. Overriding View.Accessibility...()
135 /// will be necessary to provide accessibility support for the View.
137 [EditorBrowsable(EditorBrowsableState.Never)]
141 private static IntPtr NewWithAccessibilityMode(ViewAccessibilityMode accessibilityMode)
143 switch (accessibilityMode)
145 case ViewAccessibilityMode.Custom:
147 return Interop.View.NewCustom();
149 case ViewAccessibilityMode.Default:
152 return Interop.View.New();
158 /// Creates a new instance of a view.
160 /// <since_tizen> 3 </since_tizen>
161 public View() : this(ViewAccessibilityMode.Default)
165 [EditorBrowsable(EditorBrowsableState.Never)]
166 public View(ViewAccessibilityMode accessibilityMode) : this(NewWithAccessibilityMode(accessibilityMode), true)
168 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
178 /// Create a new instance of a View with setting the status of shown or hidden.
180 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
181 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
182 [EditorBrowsable(EditorBrowsableState.Never)]
183 public View(bool shown) : this(Interop.View.New(), true)
185 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
189 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
191 InitializeStyle(viewStyle);
194 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : this(cPtr, cMemoryOwn, shown, cMemoryOwn)
198 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown, bool cRegister) : base(cPtr, cMemoryOwn, cRegister)
202 PositionUsesPivotPoint = false;
203 GrabTouchAfterLeave = defaultGrabTouchAfterLeave;
204 AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch;
213 internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
215 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
224 /// The event that is triggered when the View's ControlState is changed.
226 [EditorBrowsable(EditorBrowsableState.Never)]
227 public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
229 internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
233 /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
235 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
236 [EditorBrowsable(EditorBrowsableState.Never)]
237 public bool LayoutSet
246 /// Flag to allow Layouting to be disabled for Views.
247 /// Once a View has a Layout set then any children added to Views from then on will receive
248 /// automatic Layouts.
250 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
251 [EditorBrowsable(EditorBrowsableState.Never)]
252 public static bool LayoutingDisabled { get; set; } = true;
255 /// If set to true, the <see cref="GrabTouchAfterLeave"/> property value is set to true when all Views are created.
257 /// <param name="enable">Sets value of GrabTouchAfterLeave property</param>
258 [EditorBrowsable(EditorBrowsableState.Never)]
259 public static void SetDefaultGrabTouchAfterLeave(bool enable)
261 defaultGrabTouchAfterLeave = enable;
265 /// If set to true, the <see cref="AllowOnlyOwnTouch"/> property value is set to true when all Views are created.
267 /// <param name="enable">Sets value of AllowOnlyOwnTouch property</param>
268 [EditorBrowsable(EditorBrowsableState.Never)]
269 public static void SetDefaultAllowOnlyOwnTouch(bool enable)
271 defaultAllowOnlyOwnTouch = enable;
275 /// Deprecate. Do not use this.
276 /// The style instance applied to this view.
277 /// Note that do not modify the ViewStyle.
278 /// Modifying ViewStyle will affect other views with same ViewStyle.
280 [EditorBrowsable(EditorBrowsableState.Never)]
281 protected ViewStyle ViewStyle
285 if (themeData == null) themeData = new ThemeData();
287 if (themeData.viewStyle == null)
289 ApplyStyle(CreateViewStyle());
291 return themeData.viewStyle;
296 /// Get/Set the control state.
297 /// Note that the ControlState only available for the classes derived from Control.
298 /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
299 /// please set <see cref="EnableControlState"/> to true.
301 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
302 [EditorBrowsable(EditorBrowsableState.Never)]
303 public ControlState ControlState
307 return themeData == null ? ControlState.Normal : themeData.controlStates;
311 if (ControlState == value)
316 var prevState = ControlState;
318 if (themeData == null) themeData = new ThemeData();
319 themeData.controlStates = value;
321 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
323 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
325 if (themeData.ControlStatePropagation)
327 foreach (View child in Children)
329 ControlState allowed = child.PropagatableControlStates;
330 if (allowed.Contains(ControlState.All))
332 child.ControlState = value;
336 ControlState newControlState = child.ControlState;
338 if (allowed.Contains(ControlState.Normal))
340 if (value.Contains(ControlState.Normal))
342 newControlState += ControlState.Normal;
346 newControlState -= ControlState.Normal;
350 if (allowed.Contains(ControlState.Disabled))
352 if (value.Contains(ControlState.Disabled))
354 newControlState += ControlState.Disabled;
358 newControlState -= ControlState.Disabled;
362 if (allowed.Contains(ControlState.Selected))
364 if (value.Contains(ControlState.Selected))
366 newControlState += ControlState.Selected;
370 newControlState -= ControlState.Selected;
374 if (allowed.Contains(ControlState.Pressed))
376 if (value.Contains(ControlState.Pressed))
378 newControlState += ControlState.Pressed;
382 newControlState -= ControlState.Pressed;
386 if (allowed.Contains(ControlState.Focused))
388 if (value.Contains(ControlState.Focused))
390 newControlState += ControlState.Focused;
394 newControlState -= ControlState.Focused;
398 if (allowed.Contains(ControlState.Other))
400 if (value.Contains(ControlState.Other))
402 newControlState += ControlState.Other;
406 newControlState -= ControlState.Other;
410 if (child.ControlState != newControlState)
411 child.ControlState = newControlState;
416 OnControlStateChanged(changeInfo);
418 ControlStateChangedEvent?.Invoke(this, changeInfo);
423 /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
425 /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
426 [EditorBrowsable(EditorBrowsableState.Never)]
427 public bool ExcludeLayouting
431 return (bool)GetValue(ExcludeLayoutingProperty);
435 SetValue(ExcludeLayoutingProperty, value);
436 NotifyPropertyChanged();
440 private bool InternalExcludeLayouting
444 return excludeLayouting;
448 excludeLayouting = value;
449 if (Layout != null && Layout.SetPositionByLayout == value)
451 Layout.SetPositionByLayout = !value;
452 Layout.RequestLayout();
458 /// The StyleName, type string.
459 /// The value indicates DALi style name defined in json theme file.
461 /// <since_tizen> 3 </since_tizen>
462 public string StyleName
466 return (string)GetValue(StyleNameProperty);
470 SetValue(StyleNameProperty, value);
471 NotifyPropertyChanged();
476 /// The KeyInputFocus, type bool.
478 [EditorBrowsable(EditorBrowsableState.Never)]
479 public bool KeyInputFocus
483 return (bool)GetValue(KeyInputFocusProperty);
487 SetValue(KeyInputFocusProperty, value);
488 NotifyPropertyChanged();
493 /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
497 /// The property cascade chaining set is not recommended.
500 /// Animatable - This property can be animated using <c>Animation</c> class.
502 /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
507 /// This way is recommended for setting the property
509 /// var view = new View();
510 /// view.BackgroundColor = new Color(0.5f, 0.1f, 0, 1);
512 /// This way to set the property is prohibited
514 /// view.BackgroundColor.R = 0.5f; //This does not guarantee a proper operation
517 /// <since_tizen> 3 </since_tizen>
518 public Color BackgroundColor
522 return (Color)GetValue(BackgroundColorProperty);
526 SetValue(BackgroundColorProperty, value);
527 NotifyPropertyChanged();
532 /// The mutually exclusive with "backgroundColor" and "background" type Map.
534 /// <since_tizen> 3 </since_tizen>
535 public string BackgroundImage
539 return (string)GetValue(BackgroundImageProperty);
543 SetValue(BackgroundImageProperty, value);
544 NotifyPropertyChanged();
549 /// Get or set the border of background image.
551 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
552 [EditorBrowsable(EditorBrowsableState.Never)]
553 public Rectangle BackgroundImageBorder
557 return (Rectangle)GetValue(BackgroundImageBorderProperty);
561 SetValue(BackgroundImageBorderProperty, value);
562 NotifyPropertyChanged();
567 /// The background of view.
569 /// <since_tizen> 3 </since_tizen>
570 public Tizen.NUI.PropertyMap Background
574 return (PropertyMap)GetValue(BackgroundProperty);
578 SetValue(BackgroundProperty, value);
579 NotifyPropertyChanged();
584 /// Describes a shadow as an image for a View.
585 /// It is null by default.
588 /// Getter returns copied instance of current shadow.
591 /// The mutually exclusive with "BoxShadow".
595 /// Animatable - This property can be animated using <c>Animation</c> class.
596 /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
598 /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
600 /// Animatable sub-property : Offset.
603 [EditorBrowsable(EditorBrowsableState.Never)]
604 public ImageShadow ImageShadow
608 return (ImageShadow)GetValue(ImageShadowProperty);
612 SetValue(ImageShadowProperty, value);
613 NotifyPropertyChanged();
618 /// Describes a box shaped shadow drawing for a View.
619 /// It is null by default.
622 /// The mutually exclusive with "ImageShadow".
626 /// Animatable - This property can be animated using <c>Animation</c> class.
627 /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
629 /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
631 /// Animatable sub-property : Offset, Color, BlurRadius.
634 /// <since_tizen> 9 </since_tizen>
635 public Shadow BoxShadow
639 return (Shadow)GetValue(BoxShadowProperty);
643 SetValue(BoxShadowProperty, value);
644 NotifyPropertyChanged();
649 /// The radius for the rounded corners of the View.
650 /// This will rounds background and shadow edges.
651 /// 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).
652 /// Each radius will clamp internally to the half of smaller of the view's width or height.
653 /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
657 /// Animatable - This property can be animated using <c>Animation</c> class.
659 /// animation.AnimateTo(view, "CornerRadius", new Vector4(10, 10, 10, 10));
663 /// <since_tizen> 9 </since_tizen>
664 public Vector4 CornerRadius
668 return (Vector4)GetValue(CornerRadiusProperty);
672 SetValue(CornerRadiusProperty, value);
673 NotifyPropertyChanged();
678 /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
679 /// It is absolute by default.
680 /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
682 /// <since_tizen> 9 </since_tizen>
683 public VisualTransformPolicyType CornerRadiusPolicy
685 get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
686 set => SetValue(CornerRadiusPolicyProperty, value);
690 /// The width for the borderline of the View.
694 /// Animatable - This property can be animated using <c>Animation</c> class.
696 /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
699 /// Note that, an image background may not have borderline if it uses the Border property.
701 /// <since_tizen> 9 </since_tizen>
702 public float BorderlineWidth
706 return (float)GetValue(BorderlineWidthProperty);
710 SetValue(BorderlineWidthProperty, value);
711 NotifyPropertyChanged();
716 /// The color for the borderline of the View.
717 /// It is Color.Black by default.
721 /// Animatable - This property can be animated using <c>Animation</c> class.
723 /// animation.AnimateTo(view, "BorderlineColor", new Color(r, g, b, a));
727 /// <since_tizen> 9 </since_tizen>
728 public Color BorderlineColor
732 return (Color)GetValue(BorderlineColorProperty);
736 SetValue(BorderlineColorProperty, value);
737 NotifyPropertyChanged();
742 /// The color selector for the borderline of the View.
743 /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
744 /// So this API is internally used only.
746 internal Selector<Color> BorderlineColorSelector
750 return (Selector<Color>)GetValue(BorderlineColorSelectorProperty);
754 SetValue(BorderlineColorSelectorProperty, value);
755 NotifyPropertyChanged();
760 /// The Relative offset for the borderline of the View.
761 /// Recommended range : [-1.0f to 1.0f].
762 /// If -1.0f, draw borderline inside of the View.
763 /// If 1.0f, draw borderline outside of the View.
764 /// If 0.0f, draw borderline half inside and half outside.
765 /// It is 0.0f by default.
769 /// Animatable - This property can be animated using <c>Animation</c> class.
771 /// animation.AnimateTo(view, "BorderlineOffset", -1.0f);
775 /// <since_tizen> 9 </since_tizen>
776 public float BorderlineOffset
780 return (float)GetValue(BorderlineOffsetProperty);
784 SetValue(BorderlineOffsetProperty, value);
785 NotifyPropertyChanged();
790 /// The current state of the view.
792 /// <since_tizen> 3 </since_tizen>
797 return (States)GetValue(StateProperty);
801 SetValue(StateProperty, value);
802 NotifyPropertyChanged();
807 /// The current sub state of the view.
809 /// <since_tizen> 3 </since_tizen>
810 public States SubState
814 return (States)GetValue(SubStateProperty);
818 SetValue(SubStateProperty, value);
819 NotifyPropertyChanged();
824 /// Displays a tooltip
826 /// <since_tizen> 3 </since_tizen>
827 public Tizen.NUI.PropertyMap Tooltip
831 return (PropertyMap)GetValue(TooltipProperty);
835 SetValue(TooltipProperty, value);
836 NotifyPropertyChanged();
841 /// Displays a tooltip as a text.
843 /// <since_tizen> 3 </since_tizen>
844 public string TooltipText
848 return GetValue(TooltipTextProperty) as string;
852 SetValue(TooltipTextProperty, value);
856 private string InternalTooltipText
860 using (var propertyValue = GetProperty(Property.TOOLTIP))
862 using var propertyMap = new PropertyMap();
863 if (propertyValue != null && propertyValue.Get(propertyMap))
865 using var retrivedContentValue = propertyMap?.Find(NDalic.TooltipContent);
866 if (retrivedContentValue != null)
868 using var contextPropertyMap = new PropertyMap();
869 if (retrivedContentValue.Get(contextPropertyMap))
871 using var retrivedTextValue = contextPropertyMap?.Find(NDalic.TextVisualText);
872 if (retrivedTextValue != null && retrivedTextValue.Get(out string retrivedValue))
874 return retrivedValue;
884 var temp = new Tizen.NUI.PropertyValue(value);
885 SetProperty(View.Property.TOOLTIP, temp);
887 NotifyPropertyChanged();
892 /// The Child property of FlexContainer.<br />
893 /// The proportion of the free space in the container, the flex item will receive.<br />
894 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
896 /// <since_tizen> 3 </since_tizen>
897 [Obsolete("Deprecated in API8, will be removed in API10.")]
902 return (float)GetValue(FlexProperty);
906 SetValue(FlexProperty, value);
907 NotifyPropertyChanged();
912 /// The Child property of FlexContainer.<br />
913 /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
915 /// <since_tizen> 3 </since_tizen>
916 [Obsolete("Deprecated in API8, will be removed in API10.")]
921 return (int)GetValue(AlignSelfProperty);
925 SetValue(AlignSelfProperty, value);
926 NotifyPropertyChanged();
931 /// The Child property of FlexContainer.<br />
932 /// The space around the flex item.<br />
935 /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
937 /// <since_tizen> 3 </since_tizen>
938 [Obsolete("Deprecated in API8, will be removed in API10.")]
939 public Vector4 FlexMargin
943 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
944 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
948 SetValue(FlexMarginProperty, value);
949 NotifyPropertyChanged();
954 /// The top-left cell this child occupies, if not set, the first available cell is used.
957 /// The property cascade chaining set is not recommended.
958 /// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
961 /// This way is recommended for setting the property
963 /// var view = new View();
964 /// view.CellIndex = new Vector2(1, 3);
966 /// This way to set the property is prohibited
968 /// view.CellIndex.X = 1; //This does not guarantee a proper operation
971 /// <since_tizen> 3 </since_tizen>
972 public Vector2 CellIndex
976 return (Vector2)GetValue(CellIndexProperty);
980 SetValue(CellIndexProperty, value);
981 NotifyPropertyChanged();
986 /// The number of rows this child occupies, if not set, the default value is 1.
989 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
991 /// <since_tizen> 3 </since_tizen>
996 return (float)GetValue(RowSpanProperty);
1000 SetValue(RowSpanProperty, value);
1001 NotifyPropertyChanged();
1006 /// The number of columns this child occupies, if not set, the default value is 1.
1009 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1011 /// <since_tizen> 3 </since_tizen>
1012 public float ColumnSpan
1016 return (float)GetValue(ColumnSpanProperty);
1020 SetValue(ColumnSpanProperty, value);
1021 NotifyPropertyChanged();
1026 /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
1029 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1031 /// <since_tizen> 3 </since_tizen>
1032 public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
1036 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
1040 SetValue(CellHorizontalAlignmentProperty, value);
1041 NotifyPropertyChanged();
1046 /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
1049 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1051 /// <since_tizen> 3 </since_tizen>
1052 public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
1056 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
1060 SetValue(CellVerticalAlignmentProperty, value);
1061 NotifyPropertyChanged();
1066 /// The left focusable view.<br />
1067 /// This will return null if not set.<br />
1068 /// This will also return null if the specified left focusable view is not on a window.<br />
1070 /// <since_tizen> 3 </since_tizen>
1071 public View LeftFocusableView
1073 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1076 return (View)GetValue(LeftFocusableViewProperty);
1080 SetValue(LeftFocusableViewProperty, value);
1081 NotifyPropertyChanged();
1086 /// The right focusable view.<br />
1087 /// This will return null if not set.<br />
1088 /// This will also return null if the specified right focusable view is not on a window.<br />
1090 /// <since_tizen> 3 </since_tizen>
1091 public View RightFocusableView
1093 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1096 return (View)GetValue(RightFocusableViewProperty);
1100 SetValue(RightFocusableViewProperty, value);
1101 NotifyPropertyChanged();
1106 /// The up focusable view.<br />
1107 /// This will return null if not set.<br />
1108 /// This will also return null if the specified up focusable view is not on a window.<br />
1110 /// <since_tizen> 3 </since_tizen>
1111 public View UpFocusableView
1113 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1116 return (View)GetValue(UpFocusableViewProperty);
1120 SetValue(UpFocusableViewProperty, value);
1121 NotifyPropertyChanged();
1126 /// The down focusable view.<br />
1127 /// This will return null if not set.<br />
1128 /// This will also return null if the specified down focusable view is not on a window.<br />
1130 /// <since_tizen> 3 </since_tizen>
1131 public View DownFocusableView
1133 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1136 return (View)GetValue(DownFocusableViewProperty);
1140 SetValue(DownFocusableViewProperty, value);
1141 NotifyPropertyChanged();
1146 /// The clockwise focusable view by rotary wheel.<br />
1147 /// This will return null if not set.<br />
1148 /// This will also return null if the specified clockwise focusable view is not on a window.<br />
1150 [EditorBrowsable(EditorBrowsableState.Never)]
1151 public View ClockwiseFocusableView
1153 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1156 return (View)GetValue(ClockwiseFocusableViewProperty);
1160 SetValue(ClockwiseFocusableViewProperty, value);
1161 NotifyPropertyChanged();
1166 /// The counter clockwise focusable view by rotary wheel.<br />
1167 /// This will return null if not set.<br />
1168 /// This will also return null if the specified counter clockwise focusable view is not on a window.<br />
1170 [EditorBrowsable(EditorBrowsableState.Never)]
1171 public View CounterClockwiseFocusableView
1173 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1176 return (View)GetValue(CounterClockwiseFocusableViewProperty);
1180 SetValue(CounterClockwiseFocusableViewProperty, value);
1181 NotifyPropertyChanged();
1186 /// Whether the view should be focusable by keyboard navigation.
1188 /// <since_tizen> 3 </since_tizen>
1189 public bool Focusable
1193 SetValue(FocusableProperty, value);
1194 NotifyPropertyChanged();
1198 return (bool)GetValue(FocusableProperty);
1203 /// 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.
1204 /// Note : Default value is true.
1206 [EditorBrowsable(EditorBrowsableState.Never)]
1207 public bool FocusableChildren
1211 SetValue(FocusableChildrenProperty, value);
1212 NotifyPropertyChanged();
1216 return (bool)GetValue(FocusableChildrenProperty);
1221 /// Whether this view can focus by touch.
1222 /// If Focusable is false, FocusableInTouch is disabled.
1223 /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
1225 [EditorBrowsable(EditorBrowsableState.Never)]
1226 public bool FocusableInTouch
1230 SetValue(FocusableInTouchProperty, value);
1231 NotifyPropertyChanged();
1235 return (bool)GetValue(FocusableInTouchProperty);
1240 /// Retrieves the position of the view.
1241 /// The coordinates are relative to the view's parent.
1244 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1245 /// 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).
1246 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1247 /// and users can get the current actual values through them.
1249 /// <since_tizen> 3 </since_tizen>
1250 public Position CurrentPosition
1254 return GetCurrentPosition();
1259 /// Sets the size of a view for the width and the height.<br />
1260 /// Geometry can be scaled to fit within this area.<br />
1261 /// This does not interfere with the view's scale factor.<br />
1262 /// The views default depth is the minimum of width and height.<br />
1265 /// The property cascade chaining set is not recommended.
1268 /// This way is recommended for setting the property
1270 /// var view = new View();
1271 /// view.Size2D = new Size2D(100, 200);
1273 /// This way to set the property is prohibited
1275 /// view.Size2D.Width = 100; //This does not guarantee a proper operation
1278 /// <since_tizen> 3 </since_tizen>
1279 public Size2D Size2D
1283 var temp = (Size2D)GetValue(Size2DProperty);
1285 if (this.Layout == null)
1287 if (temp.Width < 0) { temp.Width = 0; }
1288 if (temp.Height < 0) { temp.Height = 0; }
1295 SetValue(Size2DProperty, value);
1297 NotifyPropertyChanged();
1302 /// Retrieves the size of the view.
1303 /// The coordinates are relative to the view's parent.
1306 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1307 /// 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).
1308 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1309 /// and users can get the current actual values through them.
1311 /// <since_tizen> 3 </since_tizen>
1312 public Size2D CurrentSize
1316 return GetCurrentSize();
1321 /// Retrieves and sets the view's opacity.<br />
1325 /// Animatable - This property can be animated using <c>Animation</c> class.
1327 /// animation.AnimateTo(view, "Opacity", 0.5f);
1331 /// <since_tizen> 3 </since_tizen>
1332 public float Opacity
1336 return (float)GetValue(OpacityProperty);
1340 SetValue(OpacityProperty, value);
1341 NotifyPropertyChanged();
1346 /// Sets the position of the view for X and Y.<br />
1347 /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1348 /// If the position inheritance is disabled, sets the world position.<br />
1351 /// The property cascade chaining set is not recommended.
1354 /// This way is recommended for setting the property
1356 /// var view = new View();
1357 /// view.Position2D = new Position2D(100, 200);
1359 /// This way to set the property is prohibited
1361 /// view.Position2D.X = 100; //This does not guarantee a proper operation
1364 /// <since_tizen> 3 </since_tizen>
1365 public Position2D Position2D
1369 return (Position2D)GetValue(Position2DProperty);
1373 SetValue(Position2DProperty, value);
1374 NotifyPropertyChanged();
1379 /// Retrieves the screen position of the view.<br />
1381 /// <since_tizen> 3 </since_tizen>
1382 public Vector2 ScreenPosition
1386 return GetCurrentScreenPosition();
1391 /// Retrieves the screen position and size of the view.<br />
1394 /// The float type Rectangle class is not ready yet.
1395 /// Therefore, it transmits data in Vector4 class.
1396 /// This type should later be changed to the appropriate data type.
1398 [EditorBrowsable(EditorBrowsableState.Never)]
1399 public Vector4 ScreenPositionSize
1403 return GetCurrentScreenPositionSize();
1408 /// Determines whether the pivot point should be used to determine the position of the view.
1409 /// This is false by default.
1411 /// <remarks>If false, then the top-left of the view is used for the position.
1412 /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1414 /// <since_tizen> 3 </since_tizen>
1415 public bool PositionUsesPivotPoint
1419 return (bool)GetValue(PositionUsesPivotPointProperty);
1423 SetValue(PositionUsesPivotPointProperty, value);
1424 NotifyPropertyChanged();
1429 /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead.
1431 /// <since_tizen> 3 </since_tizen>
1432 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PositionUsesPivotPoint instead. " +
1434 "View view = new View(); " +
1435 "view.PivotPoint = PivotPoint.Center; " +
1436 "view.PositionUsesPivotPoint = true;" +
1437 " This has been deprecated in API5 and will be removed in API8")]
1438 [EditorBrowsable(EditorBrowsableState.Never)]
1439 public bool PositionUsesAnchorPoint
1443 return (bool)GetValue(PositionUsesAnchorPointProperty);
1447 SetValue(PositionUsesAnchorPointProperty, value);
1451 private bool InternalPositionUsesAnchorPoint
1455 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint);
1459 Object.InternalSetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint, value);
1460 NotifyPropertyChanged();
1465 /// Queries whether the view is connected to the stage.<br />
1466 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1468 /// <since_tizen> 3 </since_tizen>
1469 public bool IsOnWindow
1478 /// Gets the depth in the hierarchy for the view.
1480 /// <since_tizen> 3 </since_tizen>
1481 public int HierarchyDepth
1485 return GetHierarchyDepth();
1490 /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1493 /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1494 /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1495 /// The values set by this property will likely change.
1497 /// <since_tizen> 3 </since_tizen>
1498 public int SiblingOrder
1502 return (int)GetValue(SiblingOrderProperty);
1506 SetValue(SiblingOrderProperty, value);
1508 Layout?.ChangeLayoutSiblingOrder(value);
1510 NotifyPropertyChanged();
1515 /// Returns the natural size of the view.
1518 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1520 /// <since_tizen> 5 </since_tizen>
1521 public Vector3 NaturalSize
1525 Vector3 ret = GetNaturalSize();
1526 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1532 /// Returns the natural size (Size2D) of the view.
1535 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1537 /// <since_tizen> 4 </since_tizen>
1538 public Size2D NaturalSize2D
1542 Vector3 temp = GetNaturalSize();
1543 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1547 sz = new Size2D((int)temp.Width, (int)temp.Height);
1555 /// Gets or sets the origin of a view within its parent's area.<br />
1556 /// 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 />
1557 /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1558 /// A view's position is the distance between this origin and the view's anchor-point.<br />
1560 /// <pre>The view has been initialized.</pre>
1561 /// <since_tizen> 3 </since_tizen>
1562 public Position ParentOrigin
1566 Position tmp = (Position)GetValue(ParentOriginProperty);
1567 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1571 SetValue(ParentOriginProperty, value);
1572 NotifyPropertyChanged();
1577 /// Gets or sets the anchor-point of a view.<br />
1578 /// 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 />
1579 /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1580 /// A view position is the distance between its parent-origin and this anchor-point.<br />
1581 /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1582 /// <pre>The view has been initialized.</pre>
1585 /// The property cascade chaining set is not recommended.
1588 /// This way is recommended for setting the property
1590 /// var view = new View();
1591 /// view.PivotPoint = PivotPoint.Center;
1593 /// This way to set the property is prohibited
1595 /// view.PivotPoint.X = 0.5f; //This does not guarantee a proper operation
1598 /// <since_tizen> 3 </since_tizen>
1599 public Position PivotPoint
1603 return (Position)GetValue(PivotPointProperty);
1607 SetValue(PivotPointProperty, value);
1608 NotifyPropertyChanged();
1613 /// Gets or sets the size width of the view.
1617 /// Animatable - This property can be animated using <c>Animation</c> class.
1619 /// animation.AnimateTo(view, "SizeWidth", 500.0f);
1623 /// <since_tizen> 3 </since_tizen>
1624 public float SizeWidth
1628 return (float)GetValue(SizeWidthProperty);
1632 SetValue(SizeWidthProperty, value);
1633 NotifyPropertyChanged();
1638 /// Gets or sets the size height of the view.
1642 /// Animatable - This property can be animated using <c>Animation</c> class.
1645 /// animation.AnimateTo(view, "SizeHeight", 500.0f);
1648 /// <since_tizen> 3 </since_tizen>
1649 public float SizeHeight
1653 return (float)GetValue(SizeHeightProperty);
1657 SetValue(SizeHeightProperty, value);
1658 NotifyPropertyChanged();
1663 /// Gets or sets the position of the view.<br />
1664 /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1665 /// If the position inheritance is disabled, sets the world position.<br />
1669 /// Animatable - This property can be animated using <c>Animation</c> class.
1671 /// animation.AnimateTo(view, "Position", new Position(50, 0));
1674 /// The property cascade chaining set is not recommended.
1677 /// This way is recommended for setting the property
1679 /// var view = new View();
1680 /// view.Position = new Position(100, 200.5f, 0);
1682 /// This way to set the property is prohibited
1684 /// view.Position.Y = 200.5f; //This does not guarantee a proper operation
1687 /// <since_tizen> 3 </since_tizen>
1688 public Position Position
1692 return (Position)GetValue(PositionProperty);
1696 SetValue(PositionProperty, value);
1697 NotifyPropertyChanged();
1702 /// Gets or sets the position X of the view.
1706 /// Animatable - This property can be animated using <c>Animation</c> class.
1708 /// animation.AnimateTo(view, "PositionX", 50.0f);
1712 /// <since_tizen> 3 </since_tizen>
1713 public float PositionX
1717 return (float)GetValue(PositionXProperty);
1721 SetValue(PositionXProperty, value);
1722 NotifyPropertyChanged();
1727 /// Gets or sets the position Y of the view.
1731 /// Animatable - This property can be animated using <c>Animation</c> class.
1733 /// animation.AnimateTo(view, "PositionY", 50.0f);
1737 /// <since_tizen> 3 </since_tizen>
1738 public float PositionY
1742 return (float)GetValue(PositionYProperty);
1746 SetValue(PositionYProperty, value);
1747 NotifyPropertyChanged();
1752 /// Gets or sets the position Z of the view.
1756 /// Animatable - This property can be animated using <c>Animation</c> class.
1758 /// animation.AnimateTo(view, "PositionZ", 50.0f);
1762 /// <since_tizen> 3 </since_tizen>
1763 public float PositionZ
1767 return (float)GetValue(PositionZProperty);
1771 SetValue(PositionZProperty, value);
1772 NotifyPropertyChanged();
1777 /// Gets or sets the world position of the view.
1779 /// <since_tizen> 3 </since_tizen>
1780 public Vector3 WorldPosition
1784 return GetCurrentWorldPosition();
1789 /// Gets or sets the orientation of the view.<br />
1790 /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1794 /// This is an asynchronous method.
1797 /// Animatable - This property can be animated using <c>Animation</c> class.
1799 /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
1803 /// <since_tizen> 3 </since_tizen>
1804 public Rotation Orientation
1808 return (Rotation)GetValue(OrientationProperty);
1812 SetValue(OrientationProperty, value);
1813 NotifyPropertyChanged();
1818 /// Gets or sets the world orientation of the view.<br />
1820 /// <since_tizen> 3 </since_tizen>
1821 public Rotation WorldOrientation
1825 Rotation temp = new Rotation();
1826 var pValue = GetProperty(View.Property.WorldOrientation);
1834 /// Gets or sets the scale factor applied to the view.<br />
1838 /// Animatable - This property can be animated using <c>Animation</c> class.
1840 /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
1843 /// The property cascade chaining set is not recommended.
1846 /// This way is recommended for setting the property
1848 /// var view = new View();
1849 /// view.Scale = new Vector3(1.5f, 2.0f, 1.0f);
1851 /// This way to set the property is prohibited
1853 /// view.Scale.Width = 1.5f; //This does not guarantee a proper operation
1856 /// <since_tizen> 3 </since_tizen>
1857 public Vector3 Scale
1861 return (Vector3)GetValue(ScaleProperty);
1865 SetValue(ScaleProperty, value);
1866 NotifyPropertyChanged();
1871 /// Gets or sets the scale X factor applied to the view.
1875 /// Animatable - This property can be animated using <c>Animation</c> class.
1877 /// animation.AnimateTo(view, "ScaleX", 1.5f);
1881 /// <since_tizen> 3 </since_tizen>
1886 return (float)GetValue(ScaleXProperty);
1890 SetValue(ScaleXProperty, value);
1891 NotifyPropertyChanged();
1896 /// Gets or sets the scale Y factor applied to the view.
1900 /// Animatable - This property can be animated using <c>Animation</c> class.
1902 /// animation.AnimateTo(view, "ScaleY", 1.5f);
1906 /// <since_tizen> 3 </since_tizen>
1911 return (float)GetValue(ScaleYProperty);
1915 SetValue(ScaleYProperty, value);
1916 NotifyPropertyChanged();
1921 /// Gets or sets the scale Z factor applied to the view.
1925 /// Animatable - This property can be animated using <c>Animation</c> class.
1927 /// animation.AnimateTo(view, "ScaleZ", 1.5f);
1931 /// <since_tizen> 3 </since_tizen>
1936 return (float)GetValue(ScaleZProperty);
1940 SetValue(ScaleZProperty, value);
1941 NotifyPropertyChanged();
1946 /// Gets the world scale of the view.
1948 /// <since_tizen> 3 </since_tizen>
1949 public Vector3 WorldScale
1953 return GetCurrentWorldScale();
1958 /// Retrieves the visibility flag of the view.
1962 /// If the view is not visible, then the view and its children will not be rendered.
1963 /// 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.
1966 /// Animatable - This property can be animated using <c>Animation</c> class.
1968 /// animation.AnimateTo(view, "Visibility", false);
1972 /// <since_tizen> 3 </since_tizen>
1973 public bool Visibility
1977 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.VISIBLE);
1982 /// Gets the view's world color.
1984 /// <since_tizen> 3 </since_tizen>
1985 public Vector4 WorldColor
1989 return GetCurrentWorldColor();
1994 /// Gets or sets the view's name.
1996 /// <since_tizen> 3 </since_tizen>
2001 return (string)GetValue(NameProperty);
2005 SetValue(NameProperty, value);
2006 NotifyPropertyChanged();
2011 /// Get the number of children held by the view.
2013 /// <since_tizen> 3 </since_tizen>
2014 public new uint ChildCount
2018 return Convert.ToUInt32(Children.Count);
2023 /// Gets the view's ID.
2026 /// <since_tizen> 3 </since_tizen>
2036 /// Gets or sets the status of whether the view should emit touch or hover signals.
2037 /// If a View is made insensitive, then the View and its children are not hittable.
2039 /// <since_tizen> 3 </since_tizen>
2040 public bool Sensitive
2044 return (bool)GetValue(SensitiveProperty);
2048 SetValue(SensitiveProperty, value);
2049 NotifyPropertyChanged();
2054 /// Gets or sets the status of whether the view should be enabled user interactions.
2055 /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled.
2057 /// <since_tizen> tizen_next </since_tizen>
2058 [EditorBrowsable(EditorBrowsableState.Never)]
2059 public bool IsEnabled
2063 return (bool)GetValue(IsEnabledProperty);
2067 SetValue(IsEnabledProperty, value);
2068 NotifyPropertyChanged();
2073 /// 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.
2075 /// <since_tizen> 3 </since_tizen>
2076 public bool LeaveRequired
2080 return (bool)GetValue(LeaveRequiredProperty);
2084 SetValue(LeaveRequiredProperty, value);
2085 NotifyPropertyChanged();
2090 /// Gets or sets the status of whether a child view inherits it's parent's orientation.
2092 /// <since_tizen> 3 </since_tizen>
2093 public bool InheritOrientation
2097 return (bool)GetValue(InheritOrientationProperty);
2101 SetValue(InheritOrientationProperty, value);
2102 NotifyPropertyChanged();
2107 /// Gets or sets the status of whether a child view inherits it's parent's scale.
2109 /// <since_tizen> 3 </since_tizen>
2110 public bool InheritScale
2114 return (bool)GetValue(InheritScaleProperty);
2118 SetValue(InheritScaleProperty, value);
2119 NotifyPropertyChanged();
2124 /// Gets or sets the status of how the view and its children should be drawn.<br />
2125 /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
2126 /// 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 />
2127 /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
2128 /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
2129 /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
2131 /// <since_tizen> 3 </since_tizen>
2132 public DrawModeType DrawMode
2136 return (DrawModeType)GetValue(DrawModeProperty);
2140 SetValue(DrawModeProperty, value);
2141 NotifyPropertyChanged();
2146 /// Gets or sets the relative to parent size factor of the view.<br />
2147 /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
2148 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
2151 /// The property cascade chaining set is not recommended.
2154 /// This way is recommended for setting the property
2156 /// var text = new TextField();
2157 /// text.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
2159 /// This way to set the property is prohibited
2161 /// text.SizeModeFactor.Width = 1.0f; //This does not guarantee a proper operation
2164 /// <since_tizen> 3 </since_tizen>
2165 public Vector3 SizeModeFactor
2169 return (Vector3)GetValue(SizeModeFactorProperty);
2173 SetValue(SizeModeFactorProperty, value);
2174 NotifyPropertyChanged();
2179 /// Gets or sets the width resize policy to be used.
2181 /// <since_tizen> 3 </since_tizen>
2182 public ResizePolicyType WidthResizePolicy
2186 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
2190 SetValue(WidthResizePolicyProperty, value);
2191 NotifyPropertyChanged();
2196 /// Gets or sets the height resize policy to be used.
2198 /// <since_tizen> 3 </since_tizen>
2199 public ResizePolicyType HeightResizePolicy
2203 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
2207 SetValue(HeightResizePolicyProperty, value);
2208 NotifyPropertyChanged();
2213 /// Gets or sets the policy to use when setting size with size negotiation.<br />
2214 /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
2216 /// <since_tizen> 3 </since_tizen>
2217 public SizeScalePolicyType SizeScalePolicy
2221 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
2225 SetValue(SizeScalePolicyProperty, value);
2226 NotifyPropertyChanged();
2231 /// Gets or sets the status of whether the width size is dependent on the height size.
2233 /// <since_tizen> 3 </since_tizen>
2234 public bool WidthForHeight
2238 return (bool)GetValue(WidthForHeightProperty);
2242 SetValue(WidthForHeightProperty, value);
2243 NotifyPropertyChanged();
2248 /// Gets or sets the status of whether the height size is dependent on the width size.
2250 /// <since_tizen> 3 </since_tizen>
2251 public bool HeightForWidth
2255 return (bool)GetValue(HeightForWidthProperty);
2259 SetValue(HeightForWidthProperty, value);
2260 NotifyPropertyChanged();
2265 /// Gets or sets the padding for use in layout.
2268 /// The property cascade chaining set is not recommended.
2271 /// This way is recommended for setting the property
2273 /// var view = new View();
2274 /// view.Padding = new Extents(5, 5, 5, 5);
2276 /// This way to set the property is prohibited
2278 /// view.Padding.Start = 5; //This does not guarantee a proper operation
2281 /// <since_tizen> 5 </since_tizen>
2282 public Extents Padding
2286 return (Extents)GetValue(PaddingProperty);
2290 SetValue(PaddingProperty, value);
2291 NotifyPropertyChanged();
2296 /// Gets or sets the minimum size the view can be assigned in size negotiation.
2298 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2300 /// The property cascade chaining set is not recommended.
2303 /// This way is recommended for setting the property
2305 /// var view = new View();
2306 /// view.MinimumSize = new Size2D(100, 200);
2308 /// This way to set the property is prohibited
2310 /// view.MinimumSize.Width = 100; //This does not guarantee a proper operation
2313 /// <since_tizen> 3 </since_tizen>
2314 public Size2D MinimumSize
2318 return (Size2D)GetValue(MinimumSizeProperty);
2324 throw new ArgumentNullException(nameof(value));
2328 // Note: it only works if minimum size is >= than natural size.
2329 // To force the size it should be done through the width&height spec or Size2D.
2330 layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
2331 layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
2332 layout.RequestLayout();
2334 SetValue(MinimumSizeProperty, value);
2335 NotifyPropertyChanged();
2340 /// Gets or sets the maximum size the view can be assigned in size negotiation.
2343 /// This way is recommended for setting the property
2345 /// var view = new View();
2346 /// view.MaximumSize = new Size2D(100, 200);
2348 /// This way to set the property is prohibited
2350 /// view.MaximumSize.Height = 200; //This does not guarantee a proper operation
2353 /// <since_tizen> 3 </since_tizen>
2354 public Size2D MaximumSize
2358 return (Size2D)GetValue(MaximumSizeProperty);
2362 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
2363 // MATCH_PARENT spec + parent container size can be used to limit
2366 layout.RequestLayout();
2368 SetValue(MaximumSizeProperty, value);
2369 NotifyPropertyChanged();
2374 /// Gets or sets whether a child view inherits it's parent's position.<br />
2375 /// Default is to inherit.<br />
2376 /// 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 />
2378 /// <since_tizen> 3 </since_tizen>
2379 public bool InheritPosition
2383 return (bool)GetValue(InheritPositionProperty);
2387 SetValue(InheritPositionProperty, value);
2388 NotifyPropertyChanged();
2393 /// Gets or sets the clipping behavior (mode) of it's children.
2395 /// <since_tizen> 3 </since_tizen>
2396 public ClippingModeType ClippingMode
2400 return (ClippingModeType)GetValue(ClippingModeProperty);
2404 SetValue(ClippingModeProperty, value);
2405 NotifyPropertyChanged();
2410 /// Gets the number of renderers held by the view.
2412 /// <since_tizen> 3 </since_tizen>
2413 public uint RendererCount
2417 return GetRendererCount();
2422 /// This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead.
2425 /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2427 /// <since_tizen> 3 </since_tizen>
2428 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead. " +
2430 "View view = new View(); " +
2431 "view.PivotPoint = PivotPoint.Center; " +
2432 "view.PositionUsesPivotPoint = true;")]
2433 [EditorBrowsable(EditorBrowsableState.Never)]
2434 public Position AnchorPoint
2438 return GetValue(AnchorPointProperty) as Position;
2442 SetValue(AnchorPointProperty, value);
2446 private Position InternalAnchorPoint
2450 return GetCurrentAnchorPoint();
2454 SetAnchorPoint(value);
2455 NotifyPropertyChanged();
2460 /// Sets the size of a view for the width, the height and the depth.<br />
2461 /// Geometry can be scaled to fit within this area.<br />
2462 /// This does not interfere with the view's scale factor.<br />
2463 /// The views default depth is the minimum of width and height.<br />
2467 /// Animatable - This property can be animated using <c>Animation</c> class.
2469 /// animation.AnimateTo(view, "Size", new Size(100, 100));
2472 /// The property cascade chaining set is not recommended.
2475 /// This way is recommended for setting the property
2477 /// var view = new View();
2478 /// view.Size = new Size(100.5f, 200, 0);
2480 /// This way to set the property is prohibited
2482 /// view.Size.Width = 100.5f; //This does not guarantee a proper operation
2485 /// <since_tizen> 5 </since_tizen>
2490 return (Size)GetValue(SizeProperty);
2494 SetValue(SizeProperty, value);
2495 NotifyPropertyChanged();
2500 /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead.
2502 /// <since_tizen> 3 </since_tizen>
2503 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. " +
2505 "Container parent = view.GetParent(); " +
2506 "View view = parent as View;")]
2507 [EditorBrowsable(EditorBrowsableState.Never)]
2508 public new View Parent
2513 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2514 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2515 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2517 if (basehandle is Layer layer)
2519 ret = new View(Layer.getCPtr(layer).Handle, false);
2520 NUILog.Error("This Parent property is deprecated, should do not be used");
2524 ret = basehandle as View;
2527 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2528 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2530 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2536 /// Gets/Sets whether inherit parent's the layout Direction.
2538 /// <since_tizen> 4 </since_tizen>
2539 public bool InheritLayoutDirection
2543 return (bool)GetValue(InheritLayoutDirectionProperty);
2547 SetValue(InheritLayoutDirectionProperty, value);
2548 NotifyPropertyChanged();
2553 /// Gets/Sets the layout Direction.
2555 /// <since_tizen> 4 </since_tizen>
2556 public ViewLayoutDirectionType LayoutDirection
2560 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2564 SetValue(LayoutDirectionProperty, value);
2565 NotifyPropertyChanged();
2566 layout?.RequestLayout();
2571 /// Gets or sets the Margin for use in layout.
2574 /// Margin property is supported by Layout algorithms and containers.
2575 /// Please Set Layout if you want to use Margin property.
2576 /// The property cascade chaining set is not recommended.
2579 /// This way is recommended for setting the property
2581 /// var view = new View();
2582 /// view.Margin = new Extents(10, 5, 15, 20);
2584 /// This way to set the property is prohibited
2586 /// view.Margin.Top = 15; //This does not guarantee a proper operation
2589 /// <since_tizen> 4 </since_tizen>
2590 public Extents Margin
2594 return (Extents)GetValue(MarginProperty);
2598 SetValue(MarginProperty, value);
2599 NotifyPropertyChanged();
2604 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2608 /// // matchParentView matches its size to its parent size.
2609 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2610 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2612 /// // wrapContentView wraps its children with their desired size.
2613 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2614 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2616 /// // exactSizeView shows itself with an exact size.
2617 /// exactSizeView.WidthSpecification = 100;
2618 /// exactSizeView.HeightSpecification = 100;
2621 /// <since_tizen> 6 </since_tizen>
2622 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2623 public int WidthSpecification
2627 return (int)GetValue(WidthSpecificationProperty);
2631 SetValue(WidthSpecificationProperty, value);
2632 NotifyPropertyChanged();
2636 private int InternalWidthSpecification
2644 if (value == widthPolicy)
2647 widthPolicy = value;
2648 if (widthPolicy >= 0)
2650 SizeWidth = widthPolicy;
2652 layout?.RequestLayout();
2657 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2661 /// // matchParentView matches its size to its parent size.
2662 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2663 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2665 /// // wrapContentView wraps its children with their desired size.
2666 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2667 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2669 /// // exactSizeView shows itself with an exact size.
2670 /// exactSizeView.WidthSpecification = 100;
2671 /// exactSizeView.HeightSpecification = 100;
2674 /// <since_tizen> 6 </since_tizen>
2675 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2676 public int HeightSpecification
2680 return (int)GetValue(HeightSpecificationProperty);
2684 SetValue(HeightSpecificationProperty, value);
2685 NotifyPropertyChanged();
2689 private int InternalHeightSpecification
2693 return heightPolicy;
2697 if (value == heightPolicy)
2700 heightPolicy = value;
2701 if (heightPolicy >= 0)
2703 SizeHeight = heightPolicy;
2705 layout?.RequestLayout();
2710 /// Gets the List of transitions for this View.
2712 /// <since_tizen> 6 </since_tizen>
2713 public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2717 if (layoutTransitions == null)
2719 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2721 return layoutTransitions;
2726 /// Sets a layout transitions for this View.
2728 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2730 /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2732 /// <since_tizen> 6 </since_tizen>
2733 public LayoutTransition LayoutTransition
2737 return GetValue(LayoutTransitionProperty) as LayoutTransition;
2741 SetValue(LayoutTransitionProperty, value);
2742 NotifyPropertyChanged();
2746 private LayoutTransition InternalLayoutTransition
2750 return layoutTransition;
2756 throw new global::System.ArgumentNullException(nameof(value));
2758 if (layoutTransitions == null)
2760 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2763 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
2765 AttachTransitionsToChildren(value);
2767 layoutTransition = value;
2772 /// This has been deprecated in API5 and will be removed in API8. Use Padding instead.
2775 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2777 /// <since_tizen> 4 </since_tizen>
2778 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use Padding instead.")]
2779 [EditorBrowsable(EditorBrowsableState.Never)]
2780 public Extents PaddingEX
2784 return GetValue(PaddingEXProperty) as Extents;
2788 SetValue(PaddingEXProperty, value);
2792 private Extents InternalPaddingEX
2796 Extents temp = new Extents(0, 0, 0, 0);
2797 var pValue = GetProperty(View.Property.PADDING);
2800 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2806 var temp = new Tizen.NUI.PropertyValue(value);
2807 SetProperty(View.Property.PADDING, temp);
2809 NotifyPropertyChanged();
2810 layout?.RequestLayout();
2815 /// The Color of View. This is an RGBA value.
2816 /// Each RGBA components match as <see cref="ColorRed"/>, <see cref="ColorGreen"/>, <see cref="ColorBlue"/>, and <see cref="Opacity"/>.
2817 /// This property will multiply the final color of this view. (BackgroundColor, BorderlineColor, BackgroundImage, etc).
2818 /// For example, if view.BackgroundColor = Color.Yellow and view.Color = Color.Purple, this view will shown as Red.
2819 /// Inherient of color value depend on <see cref="ColorMode"/>.
2823 /// Animatable - This property can be animated using <c>Animation</c> class.
2825 /// The property cascade chaining set is not recommended.
2828 /// This way is recommended for setting the property
2830 /// var view = new View();
2831 /// view.Color = new Color(0.5f, 0.2f, 0.1f, 0.5f);
2833 /// This way to set the property is prohibited
2835 /// view.Color.A = 0.5f; //This does not guarantee a proper operation
2838 [EditorBrowsable(EditorBrowsableState.Never)]
2843 return (Color)GetValue(ColorProperty);
2847 SetValue(ColorProperty, value);
2848 NotifyPropertyChanged();
2853 /// The Red component of View.Color.
2857 /// Animatable - This property can be animated using <c>Animation</c> class.
2860 [EditorBrowsable(EditorBrowsableState.Never)]
2861 public float ColorRed
2865 return (float)GetValue(ColorRedProperty);
2869 SetValue(ColorRedProperty, value);
2870 NotifyPropertyChanged();
2875 /// The Green component of View.Color.
2879 /// Animatable - This property can be animated using <c>Animation</c> class.
2882 [EditorBrowsable(EditorBrowsableState.Never)]
2883 public float ColorGreen
2887 return (float)GetValue(ColorGreenProperty);
2891 SetValue(ColorGreenProperty, value);
2892 NotifyPropertyChanged();
2897 /// The Blue component of View.Color.
2901 /// Animatable - This property can be animated using <c>Animation</c> class.
2904 [EditorBrowsable(EditorBrowsableState.Never)]
2905 public float ColorBlue
2909 return (float)GetValue(ColorBlueProperty);
2913 SetValue(ColorBlueProperty, value);
2914 NotifyPropertyChanged();
2919 /// Set the layout on this View. Replaces any existing Layout.
2922 /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
2924 /// <since_tizen> 6 </since_tizen>
2925 public LayoutItem Layout
2929 return GetValue(LayoutProperty) as LayoutItem;
2933 SetValue(LayoutProperty, value);
2937 private LayoutItem InternalLayout
2945 // Do nothing if layout provided is already set on this View.
2946 if (value == layout)
2951 LayoutingDisabled = false;
2954 // If new layout being set already has a owner then that owner receives a replacement default layout.
2955 // First check if the layout to be set already has a owner.
2956 if (value?.Owner != null)
2958 // Previous owner of the layout gets a default layout as a replacement.
2959 value.Owner.Layout = new AbsoluteLayout()
2961 // Copy Margin and Padding to replacement LayoutGroup.
2962 Margin = value.Margin,
2963 Padding = value.Padding,
2967 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2968 // View if no replacement. Previously margin and padding values would have been moved from
2969 // the View to the layout.
2970 if (layout != null) // Existing layout
2974 // Existing layout being replaced so copy over margin and padding values.
2975 value.Margin = layout.Margin;
2976 value.Padding = layout.Padding;
2977 value.SetPositionByLayout = !excludeLayouting;
2981 // Layout not being replaced so restore margin and padding to View.
2982 SetValue(MarginProperty, layout.Margin);
2983 SetValue(PaddingProperty, layout.Padding);
2984 NotifyPropertyChanged();
2989 // First Layout to be added to the View hence copy
2991 // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2994 Extents margin = Margin;
2995 Extents padding = Padding;
2996 bool setMargin = false;
2997 bool setPadding = false;
2999 if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
3001 // If View already has a margin set then store it in Layout instead.
3002 value.Margin = margin;
3003 SetValue(MarginProperty, new Extents(0, 0, 0, 0));
3007 if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
3009 // If View already has a padding set then store it in Layout instead.
3010 value.Padding = padding;
3011 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
3015 if (setMargin || setPadding)
3017 NotifyPropertyChanged();
3020 value.SetPositionByLayout = !excludeLayouting;
3024 // Remove existing layout from it's parent layout group.
3027 // Set layout to this view
3033 /// The weight of the View, used to share available space in a layout with siblings.
3035 /// <since_tizen> 6 </since_tizen>
3045 layout?.RequestLayout();
3050 /// Whether to load the BackgroundImage synchronously.
3051 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3052 /// Note: For Normal Quad images only.
3054 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
3055 [EditorBrowsable(EditorBrowsableState.Never)]
3056 public bool BackgroundImageSynchronosLoading
3060 return (bool)GetValue(BackgroundImageSynchronosLoadingProperty);
3064 SetValue(BackgroundImageSynchronosLoadingProperty, value);
3065 NotifyPropertyChanged();
3069 private bool InternalBackgroundImageSynchronosLoading
3073 return BackgroundImageSynchronousLoading;
3077 BackgroundImageSynchronousLoading = value;
3082 /// Whether to load the BackgroundImage synchronously.
3083 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3084 /// Note: For Normal Quad images only.
3086 /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3087 [EditorBrowsable(EditorBrowsableState.Never)]
3088 public bool BackgroundImageSynchronousLoading
3092 return (bool)GetValue(BackgroundImageSynchronousLoadingProperty);
3096 SetValue(BackgroundImageSynchronousLoadingProperty, value);
3097 NotifyPropertyChanged();
3101 private bool InternalBackgroundImageSynchronousLoading
3105 return backgroundImageSynchronousLoading;
3109 backgroundImageSynchronousLoading = value;
3111 if (!string.IsNullOrEmpty(BackgroundImage))
3113 PropertyMap bgMap = this.Background;
3114 var temp = new PropertyValue(backgroundImageSynchronousLoading);
3115 bgMap[ImageVisualProperty.SynchronousLoading] = temp;
3122 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3123 [EditorBrowsable(EditorBrowsableState.Never)]
3124 public Vector4 UpdateAreaHint
3128 return (Vector4)GetValue(UpdateAreaHintProperty);
3132 SetValue(UpdateAreaHintProperty, value);
3133 NotifyPropertyChanged();
3138 /// Enable/Disable ControlState propagation for children.
3139 /// It is false by default.
3140 /// If the View needs to share ControlState with descendants, please set it true.
3141 /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
3143 [EditorBrowsable(EditorBrowsableState.Never)]
3144 public bool EnableControlStatePropagation
3148 return (bool)GetValue(EnableControlStatePropagationProperty);
3152 SetValue(EnableControlStatePropagationProperty, value);
3153 NotifyPropertyChanged();
3157 private bool InternalEnableControlStatePropagation
3159 get => themeData?.ControlStatePropagation ?? false;
3162 if (InternalEnableControlStatePropagation == value) return;
3164 if (themeData == null) themeData = new ThemeData();
3166 themeData.ControlStatePropagation = value;
3168 foreach (View child in Children)
3170 child.EnableControlStatePropagation = value;
3176 /// The ControlStates can propagate from the parent.
3177 /// Listed ControlStates will be accepted propagation of the parent ControlState changes
3178 /// if parent view EnableControlState is true.
3179 /// <see cref="EnableControlState"/>.
3180 /// Default is ControlState.All, so every ControlStates will be propagated from the parent.
3182 [EditorBrowsable(EditorBrowsableState.Never)]
3183 public ControlState PropagatableControlStates
3187 return (ControlState)GetValue(PropagatableControlStatesProperty);
3191 SetValue(PropagatableControlStatesProperty, value);
3192 NotifyPropertyChanged();
3196 private ControlState InternalPropagatableControlStates
3198 get => propagatableControlStates;
3199 set => propagatableControlStates = value;
3203 /// By default, it is false in View, true in Control.
3204 /// Note that if the value is true, the View will be a touch receptor.
3206 [EditorBrowsable(EditorBrowsableState.Never)]
3207 public bool EnableControlState
3211 return (bool)GetValue(EnableControlStateProperty);
3215 SetValue(EnableControlStateProperty, value);
3220 /// Whether the actor grab all touches even if touch leaves its boundary.
3222 /// <returns>true, if it grab all touch after start</returns>
3223 [EditorBrowsable(EditorBrowsableState.Never)]
3224 public bool GrabTouchAfterLeave
3228 return (bool)GetValue(GrabTouchAfterLeaveProperty);
3232 SetValue(GrabTouchAfterLeaveProperty, value);
3236 private bool InternalGrabTouchAfterLeave
3240 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart);
3244 Object.InternalSetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart, value);
3246 // Use custom HitTest callback only if GrabTouchAfterLeave is true.
3249 RegisterHitTestCallback();
3253 UnregisterHitTestCallback();
3256 NotifyPropertyChanged();
3261 /// Whether the view will only receive own touch.
3263 /// <returns>true, if it only receives touches that started from itself.</returns>
3264 [EditorBrowsable(EditorBrowsableState.Never)]
3265 public bool AllowOnlyOwnTouch
3269 return (bool)GetValue(AllowOnlyOwnTouchProperty);
3273 SetValue(AllowOnlyOwnTouchProperty, value);
3277 private bool InternalAllowOnlyOwnTouch
3281 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch);
3285 Object.InternalSetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch, value);
3286 NotifyPropertyChanged();
3291 /// Determines which blend equation will be used to render renderers of this actor.
3293 /// <returns>blend equation enum currently assigned</returns>
3294 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
3295 [EditorBrowsable(EditorBrowsableState.Never)]
3296 public BlendEquationType BlendEquation
3300 return (BlendEquationType)GetValue(BlendEquationProperty);
3304 SetValue(BlendEquationProperty, value);
3308 private BlendEquationType InternalBlendEquation
3312 return (BlendEquationType)Object.InternalGetPropertyInt(SwigCPtr, View.Property.BlendEquation);
3316 Object.InternalSetPropertyInt(SwigCPtr, View.Property.BlendEquation, (int)value);
3317 NotifyPropertyChanged();
3322 /// If the value is true, the View will change its style as the theme changes.
3323 /// The default value is false in normal case but it can be true when the NUIApplication is created with <see cref="NUIApplication.ThemeOptions.ThemeChangeSensitive"/>.
3325 /// <since_tizen> 9 </since_tizen>
3326 public bool ThemeChangeSensitive
3328 get => (bool)GetValue(ThemeChangeSensitiveProperty);
3329 set => SetValue(ThemeChangeSensitiveProperty, value);
3333 /// Create Style, it is abstract function and must be override.
3335 [EditorBrowsable(EditorBrowsableState.Never)]
3336 protected virtual ViewStyle CreateViewStyle()
3338 return new ViewStyle();
3342 /// Called after the View's ControlStates changed.
3344 /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
3345 [EditorBrowsable(EditorBrowsableState.Never)]
3346 protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
3352 [EditorBrowsable(EditorBrowsableState.Never)]
3353 protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
3355 isThemeChanged = true;
3356 if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
3357 else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
3358 isThemeChanged = false;
3362 /// Apply style instance to the view.
3363 /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
3365 /// <since_tizen> 9 </since_tizen>
3366 public virtual void ApplyStyle(ViewStyle viewStyle)
3368 if (viewStyle == null || themeData?.viewStyle == viewStyle) return;
3370 if (themeData == null) themeData = new ThemeData();
3372 themeData.viewStyle = viewStyle;
3374 if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
3380 BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
3382 if (bindablePropertyOfView == null)
3387 var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
3388 viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
3390 foreach (var sourceProperty in dirtyStyleProperties)
3392 var sourceValue = viewStyle.GetValue(sourceProperty);
3394 if (sourceValue == null)
3399 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
3401 // Do not set value again when theme is changed and the value has been set already.
3402 if (isThemeChanged && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty))
3407 if (destinationProperty != null)
3409 InternalSetValue(destinationProperty, sourceValue);
3415 /// Get whether the View is culled or not.
3416 /// True means that the View is out of the view frustum.
3419 /// Hidden-API (Inhouse-API).
3421 [EditorBrowsable(EditorBrowsableState.Never)]
3426 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.Culled);
3431 /// Set or Get TransitionOptions for the page transition.
3432 /// This property is used to define how this view will be transitioned during Page switching.
3434 /// <since_tizen> 9 </since_tizen>
3435 public TransitionOptions TransitionOptions
3439 return GetValue(TransitionOptionsProperty) as TransitionOptions;
3443 SetValue(TransitionOptionsProperty, value);
3444 NotifyPropertyChanged();
3448 private TransitionOptions InternalTransitionOptions
3452 transitionOptions = value;
3456 return transitionOptions;
3461 /// Called when the view is hit through TouchEvent or GestureEvent.
3462 /// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
3463 /// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
3464 /// User can override whether hit or not in HitTest.
3465 /// You can get the coordinates relative to tthe top-left of the hit view by touch.GetLocalPosition(0).
3466 /// or you can get the coordinates relative to the top-left of the screen by touch.GetScreenPosition(0).
3468 // <param name="touch"><see cref="Tizen.NUI.Touch"/>The touch data</param>
3469 [EditorBrowsable(EditorBrowsableState.Never)]
3470 protected virtual bool HitTest(Touch touch)
3476 /// Retrieve the View's current Color.
3479 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3480 /// 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).
3481 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3482 /// and users can get the current actual values through them.
3484 [EditorBrowsable(EditorBrowsableState.Never)]
3485 public Color CurrentColor => GetCurrentColor();
3488 /// Retrieve the current scale factor applied to the View.
3491 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3492 /// 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).
3493 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3494 /// and users can get the current actual values through them.
3496 [EditorBrowsable(EditorBrowsableState.Never)]
3497 public Vector3 CurrentScale => GetCurrentScale();