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 // List of dispatch Event
76 private PanGestureDetector panGestureDetector = null;
77 private LongPressGestureDetector longGestureDetector = null;
78 private PinchGestureDetector pinchGestureDetector = null;
79 private TapGestureDetector tapGestureDetector = null;
80 private RotationGestureDetector rotationGestureDetector = null;
81 private int configGestureCount = 0;
82 private bool dispatchTouchEvents = true;
83 private bool dispatchGestureEvents = true;
84 private bool dispatchParentGestureEvents = true;
86 #if NUI_PROPERTY_CHANGE_DEBUG
87 internal static int LayoutSetGetter = 0;
88 internal static int SizeGetter = 0;
89 internal static int SizeSetter = 0;
90 internal static int Size2DGetter = 0;
91 internal static int Size2DSetter = 0;
92 internal static int MaximumSizeGetter = 0;
93 internal static int MaximumSizeSetter = 0;
94 internal static int MinimumSizeGetter = 0;
95 internal static int MinimumSizeSetter = 0;
96 internal static int PositionGetter = 0;
97 internal static int PositionSetter = 0;
98 internal static int Position2DGetter = 0;
99 internal static int Position2DSetter = 0;
100 internal static int SizeWidthGetter = 0;
101 internal static int SizeWidthSetter = 0;
102 internal static int SizeHeightGetter = 0;
103 internal static int SizeHeightSetter = 0;
104 internal static int PositionXGetter = 0;
105 internal static int PositionXSetter = 0;
106 internal static int PositionYGetter = 0;
107 internal static int PositionYSetter = 0;
108 internal static int PositionZGetter = 0;
109 internal static int PositionZSetter = 0;
114 RegisterPropertyGroup(PositionProperty, positionPropertyGroup);
115 RegisterPropertyGroup(Position2DProperty, positionPropertyGroup);
116 RegisterPropertyGroup(PositionXProperty, positionPropertyGroup);
117 RegisterPropertyGroup(PositionYProperty, positionPropertyGroup);
119 RegisterPropertyGroup(SizeProperty, sizePropertyGroup);
120 RegisterPropertyGroup(Size2DProperty, sizePropertyGroup);
121 RegisterPropertyGroup(SizeWidthProperty, sizePropertyGroup);
122 RegisterPropertyGroup(SizeHeightProperty, sizePropertyGroup);
124 RegisterPropertyGroup(ScaleProperty, scalePropertyGroup);
125 RegisterPropertyGroup(ScaleXProperty, scalePropertyGroup);
126 RegisterPropertyGroup(ScaleYProperty, scalePropertyGroup);
127 RegisterPropertyGroup(ScaleZProperty, scalePropertyGroup);
129 RegisterAccessibilityDelegate();
133 /// Creates a new instance of a view.
135 /// <since_tizen> 3 </since_tizen>
136 public View() : this(Interop.View.New(), true)
138 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
141 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
142 [EditorBrowsable(EditorBrowsableState.Never)]
143 public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
148 /// Create a new instance of a View with setting the status of shown or hidden.
150 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
151 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
152 [EditorBrowsable(EditorBrowsableState.Never)]
153 public View(bool shown) : this(Interop.View.New(), true)
155 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
159 internal View(View uiControl, bool shown = true) : this(Interop.View.NewView(View.getCPtr(uiControl)), true)
161 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
167 backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
170 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
172 InitializeStyle(viewStyle);
175 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn)
179 PositionUsesPivotPoint = false;
182 onWindowSendEventCallback = SendViewAddedEventToWindow;
183 using ViewSignal signal = new ViewSignal(Interop.ActorSignal.ActorOnSceneSignal(SwigCPtr), false);
184 signal?.Connect(onWindowSendEventCallback);
186 hitTestResultDataCallback = OnHitTestResult;
187 using TouchDataSignal touchDataSignal = new TouchDataSignal(Interop.ActorSignal.ActorHitTestResultSignal(SwigCPtr), false);
188 touchDataSignal?.Connect(hitTestResultDataCallback);
195 GrabTouchAfterLeave = defaultGrabTouchAfterLeave;
196 AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch;
199 internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
201 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
210 /// The event that is triggered when the View's ControlState is changed.
212 [EditorBrowsable(EditorBrowsableState.Never)]
213 public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
215 internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
219 /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
221 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
222 [EditorBrowsable(EditorBrowsableState.Never)]
223 public bool LayoutSet
227 #if NUI_PROPERTY_CHANGE_DEBUG
235 /// Flag to allow Layouting to be disabled for Views.
236 /// Once a View has a Layout set then any children added to Views from then on will receive
237 /// automatic Layouts.
239 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
240 [EditorBrowsable(EditorBrowsableState.Never)]
241 public static bool LayoutingDisabled { get; set; } = true;
244 /// If set to true, the <see cref="GrabTouchAfterLeave"/> property value is set to true when all Views are created.
246 /// <param name="enable">Sets value of GrabTouchAfterLeave property</param>
247 [EditorBrowsable(EditorBrowsableState.Never)]
248 public static void SetDefaultGrabTouchAfterLeave(bool enable)
250 defaultGrabTouchAfterLeave = enable;
254 /// If set to true, the <see cref="AllowOnlyOwnTouch"/> property value is set to true when all Views are created.
256 /// <param name="enable">Sets value of AllowOnlyOwnTouch property</param>
257 [EditorBrowsable(EditorBrowsableState.Never)]
258 public static void SetDefaultAllowOnlyOwnTouch(bool enable)
260 defaultAllowOnlyOwnTouch = enable;
264 /// Deprecate. Do not use this.
265 /// The style instance applied to this view.
266 /// Note that do not modify the ViewStyle.
267 /// Modifying ViewStyle will affect other views with same ViewStyle.
269 [EditorBrowsable(EditorBrowsableState.Never)]
270 protected ViewStyle ViewStyle
274 if (themeData == null) themeData = new ThemeData();
276 if (themeData.viewStyle == null)
278 ApplyStyle(CreateViewStyle());
280 return themeData.viewStyle;
285 /// Get/Set the control state.
286 /// Note that the ControlState only available for the classes derived from Control.
287 /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
288 /// please set <see cref="EnableControlState"/> to true.
290 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
291 [EditorBrowsable(EditorBrowsableState.Never)]
292 public ControlState ControlState
296 return themeData == null ? ControlState.Normal : themeData.controlStates;
300 if (ControlState == value)
305 var prevState = ControlState;
307 if (themeData == null) themeData = new ThemeData();
308 themeData.controlStates = value;
310 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
312 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
314 if (themeData.ControlStatePropagation)
316 foreach (View child in Children)
318 ControlState allowed = child.PropagatableControlStates;
319 if (allowed.Contains(ControlState.All))
321 child.ControlState = value;
325 ControlState newControlState = child.ControlState;
327 if (allowed.Contains(ControlState.Normal))
329 if (value.Contains(ControlState.Normal))
331 newControlState += ControlState.Normal;
335 newControlState -= ControlState.Normal;
339 if (allowed.Contains(ControlState.Disabled))
341 if (value.Contains(ControlState.Disabled))
343 newControlState += ControlState.Disabled;
347 newControlState -= ControlState.Disabled;
351 if (allowed.Contains(ControlState.Selected))
353 if (value.Contains(ControlState.Selected))
355 newControlState += ControlState.Selected;
359 newControlState -= ControlState.Selected;
363 if (allowed.Contains(ControlState.Pressed))
365 if (value.Contains(ControlState.Pressed))
367 newControlState += ControlState.Pressed;
371 newControlState -= ControlState.Pressed;
375 if (allowed.Contains(ControlState.Focused))
377 if (value.Contains(ControlState.Focused))
379 newControlState += ControlState.Focused;
383 newControlState -= ControlState.Focused;
387 if (allowed.Contains(ControlState.Other))
389 if (value.Contains(ControlState.Other))
391 newControlState += ControlState.Other;
395 newControlState -= ControlState.Other;
399 if (child.ControlState != newControlState)
400 child.ControlState = newControlState;
405 OnControlStateChanged(changeInfo);
407 ControlStateChangedEvent?.Invoke(this, changeInfo);
412 /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
414 /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
415 [EditorBrowsable(EditorBrowsableState.Never)]
416 public bool ExcludeLayouting
420 return (bool)GetValue(ExcludeLayoutingProperty);
424 SetValue(ExcludeLayoutingProperty, value);
425 NotifyPropertyChanged();
429 private bool InternalExcludeLayouting
433 return excludeLayouting;
437 excludeLayouting = value;
438 if (Layout != null && Layout.SetPositionByLayout == value)
440 Layout.SetPositionByLayout = !value;
441 Layout.RequestLayout();
447 /// The StyleName, type string.
448 /// The value indicates DALi style name defined in json theme file.
450 /// <since_tizen> 3 </since_tizen>
451 public string StyleName
455 return (string)GetValue(StyleNameProperty);
459 SetValue(StyleNameProperty, value);
460 NotifyPropertyChanged();
465 /// The KeyInputFocus, type bool.
467 [EditorBrowsable(EditorBrowsableState.Never)]
468 public bool KeyInputFocus
472 return (bool)GetValue(KeyInputFocusProperty);
476 SetValue(KeyInputFocusProperty, value);
477 NotifyPropertyChanged();
482 /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
486 /// The property cascade chaining set is not recommended.
489 /// Animatable - This property can be animated using <c>Animation</c> class.
491 /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
496 /// This way is recommended for setting the property
498 /// var view = new View();
499 /// view.BackgroundColor = new Color(0.5f, 0.1f, 0, 1);
501 /// This way to set the property is prohibited
503 /// view.BackgroundColor.R = 0.5f; //This does not guarantee a proper operation
506 /// <since_tizen> 3 </since_tizen>
507 public Color BackgroundColor
511 return (Color)GetValue(BackgroundColorProperty);
515 SetValue(BackgroundColorProperty, value);
516 NotifyPropertyChanged();
521 /// The mutually exclusive with "backgroundColor" and "background" type Map.
523 /// <since_tizen> 3 </since_tizen>
524 public string BackgroundImage
528 return (string)GetValue(BackgroundImageProperty);
532 SetValue(BackgroundImageProperty, value);
533 NotifyPropertyChanged();
538 /// Get or set the border of background image.
540 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
541 [EditorBrowsable(EditorBrowsableState.Never)]
542 public Rectangle BackgroundImageBorder
546 return (Rectangle)GetValue(BackgroundImageBorderProperty);
550 SetValue(BackgroundImageBorderProperty, value);
551 NotifyPropertyChanged();
556 /// The background of view.
558 /// <since_tizen> 3 </since_tizen>
559 public Tizen.NUI.PropertyMap Background
563 return (PropertyMap)GetValue(BackgroundProperty);
567 SetValue(BackgroundProperty, value);
568 NotifyPropertyChanged();
573 /// Describes a shadow as an image for a View.
574 /// It is null by default.
577 /// Getter returns copied instance of current shadow.
580 /// The mutually exclusive with "BoxShadow".
584 /// Animatable - This property can be animated using <c>Animation</c> class.
585 /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
587 /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
589 /// Animatable sub-property : Offset.
592 [EditorBrowsable(EditorBrowsableState.Never)]
593 public ImageShadow ImageShadow
597 return (ImageShadow)GetValue(ImageShadowProperty);
601 SetValue(ImageShadowProperty, value);
602 NotifyPropertyChanged();
607 /// Describes a box shaped shadow drawing for a View.
608 /// It is null by default.
611 /// The mutually exclusive with "ImageShadow".
615 /// Animatable - This property can be animated using <c>Animation</c> class.
616 /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
618 /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
620 /// Animatable sub-property : Offset, Color, BlurRadius.
623 /// <since_tizen> 9 </since_tizen>
624 public Shadow BoxShadow
628 return (Shadow)GetValue(BoxShadowProperty);
632 SetValue(BoxShadowProperty, value);
633 NotifyPropertyChanged();
638 /// The radius for the rounded corners of the View.
639 /// This will rounds background and shadow edges.
640 /// 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).
641 /// Each radius will clamp internally to the half of smaller of the view's width or height.
642 /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
646 /// Animatable - This property can be animated using <c>Animation</c> class.
648 /// animation.AnimateTo(view, "CornerRadius", new Vector4(10, 10, 10, 10));
652 /// <since_tizen> 9 </since_tizen>
653 public Vector4 CornerRadius
657 return (Vector4)GetValue(CornerRadiusProperty);
661 SetValue(CornerRadiusProperty, value);
662 NotifyPropertyChanged();
667 /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
668 /// It is absolute by default.
669 /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
671 /// <since_tizen> 9 </since_tizen>
672 public VisualTransformPolicyType CornerRadiusPolicy
674 get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
675 set => SetValue(CornerRadiusPolicyProperty, value);
679 /// The width for the borderline of the View.
683 /// Animatable - This property can be animated using <c>Animation</c> class.
685 /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
688 /// Note that, an image background may not have borderline if it uses the Border property.
690 /// <since_tizen> 9 </since_tizen>
691 public float BorderlineWidth
695 return (float)GetValue(BorderlineWidthProperty);
699 SetValue(BorderlineWidthProperty, value);
700 NotifyPropertyChanged();
705 /// The color for the borderline of the View.
706 /// It is Color.Black by default.
710 /// Animatable - This property can be animated using <c>Animation</c> class.
712 /// animation.AnimateTo(view, "BorderlineColor", new Color(r, g, b, a));
716 /// <since_tizen> 9 </since_tizen>
717 public Color BorderlineColor
721 return (Color)GetValue(BorderlineColorProperty);
725 SetValue(BorderlineColorProperty, value);
726 NotifyPropertyChanged();
731 /// The color selector for the borderline of the View.
732 /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
733 /// So this API is internally used only.
735 internal Selector<Color> BorderlineColorSelector
739 return (Selector<Color>)GetValue(BorderlineColorSelectorProperty);
743 SetValue(BorderlineColorSelectorProperty, value);
744 NotifyPropertyChanged();
749 /// The Relative offset for the borderline of the View.
750 /// Recommended range : [-1.0f to 1.0f].
751 /// If -1.0f, draw borderline inside of the View.
752 /// If 1.0f, draw borderline outside of the View.
753 /// If 0.0f, draw borderline half inside and half outside.
754 /// It is 0.0f by default.
758 /// Animatable - This property can be animated using <c>Animation</c> class.
760 /// animation.AnimateTo(view, "BorderlineOffset", -1.0f);
764 /// <since_tizen> 9 </since_tizen>
765 public float BorderlineOffset
769 return (float)GetValue(BorderlineOffsetProperty);
773 SetValue(BorderlineOffsetProperty, value);
774 NotifyPropertyChanged();
779 /// The current state of the view.
781 /// <since_tizen> 3 </since_tizen>
786 return (States)GetValue(StateProperty);
790 SetValue(StateProperty, value);
791 NotifyPropertyChanged();
796 /// The current sub state of the view.
798 /// <since_tizen> 3 </since_tizen>
799 public States SubState
803 return (States)GetValue(SubStateProperty);
807 SetValue(SubStateProperty, value);
808 NotifyPropertyChanged();
813 /// Displays a tooltip
815 /// <since_tizen> 3 </since_tizen>
816 public Tizen.NUI.PropertyMap Tooltip
820 return (PropertyMap)GetValue(TooltipProperty);
824 SetValue(TooltipProperty, value);
825 NotifyPropertyChanged();
830 /// Displays a tooltip as a text.
832 /// <since_tizen> 3 </since_tizen>
833 public string TooltipText
837 return GetValue(TooltipTextProperty) as string;
841 SetValue(TooltipTextProperty, value);
845 private string InternalTooltipText
849 using (var propertyValue = GetProperty(Property.TOOLTIP))
851 if (propertyValue != null && propertyValue.Get(out string retrivedValue))
853 return retrivedValue;
855 NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
856 return "error to get TooltipText";
861 var temp = new Tizen.NUI.PropertyValue(value);
862 SetProperty(View.Property.TOOLTIP, temp);
864 NotifyPropertyChanged();
869 /// The Child property of FlexContainer.<br />
870 /// The proportion of the free space in the container, the flex item will receive.<br />
871 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
873 /// <since_tizen> 3 </since_tizen>
874 [Obsolete("Deprecated in API8, will be removed in API10.")]
879 return (float)GetValue(FlexProperty);
883 SetValue(FlexProperty, value);
884 NotifyPropertyChanged();
889 /// The Child property of FlexContainer.<br />
890 /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
892 /// <since_tizen> 3 </since_tizen>
893 [Obsolete("Deprecated in API8, will be removed in API10.")]
898 return (int)GetValue(AlignSelfProperty);
902 SetValue(AlignSelfProperty, value);
903 NotifyPropertyChanged();
908 /// The Child property of FlexContainer.<br />
909 /// The space around the flex item.<br />
912 /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
914 /// <since_tizen> 3 </since_tizen>
915 [Obsolete("Deprecated in API8, will be removed in API10.")]
916 public Vector4 FlexMargin
920 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
921 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
925 SetValue(FlexMarginProperty, value);
926 NotifyPropertyChanged();
931 /// The top-left cell this child occupies, if not set, the first available cell is used.
934 /// The property cascade chaining set is not recommended.
935 /// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
938 /// This way is recommended for setting the property
940 /// var view = new View();
941 /// view.CellIndex = new Vector2(1, 3);
943 /// This way to set the property is prohibited
945 /// view.CellIndex.X = 1; //This does not guarantee a proper operation
948 /// <since_tizen> 3 </since_tizen>
949 public Vector2 CellIndex
953 return (Vector2)GetValue(CellIndexProperty);
957 SetValue(CellIndexProperty, value);
958 NotifyPropertyChanged();
963 /// The number of rows this child occupies, if not set, the default value is 1.
966 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
968 /// <since_tizen> 3 </since_tizen>
973 return (float)GetValue(RowSpanProperty);
977 SetValue(RowSpanProperty, value);
978 NotifyPropertyChanged();
983 /// The number of columns 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>
989 public float ColumnSpan
993 return (float)GetValue(ColumnSpanProperty);
997 SetValue(ColumnSpanProperty, value);
998 NotifyPropertyChanged();
1003 /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
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 Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
1013 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
1017 SetValue(CellHorizontalAlignmentProperty, value);
1018 NotifyPropertyChanged();
1023 /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
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.VerticalAlignmentType CellVerticalAlignment
1033 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
1037 SetValue(CellVerticalAlignmentProperty, value);
1038 NotifyPropertyChanged();
1043 /// The left focusable view.<br />
1044 /// This will return null if not set.<br />
1045 /// This will also return null if the specified left focusable view is not on a window.<br />
1047 /// <since_tizen> 3 </since_tizen>
1048 public View LeftFocusableView
1050 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1053 return (View)GetValue(LeftFocusableViewProperty);
1057 SetValue(LeftFocusableViewProperty, value);
1058 NotifyPropertyChanged();
1063 /// The right focusable view.<br />
1064 /// This will return null if not set.<br />
1065 /// This will also return null if the specified right focusable view is not on a window.<br />
1067 /// <since_tizen> 3 </since_tizen>
1068 public View RightFocusableView
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(RightFocusableViewProperty);
1077 SetValue(RightFocusableViewProperty, value);
1078 NotifyPropertyChanged();
1083 /// The up focusable view.<br />
1084 /// This will return null if not set.<br />
1085 /// This will also return null if the specified up focusable view is not on a window.<br />
1087 /// <since_tizen> 3 </since_tizen>
1088 public View UpFocusableView
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(UpFocusableViewProperty);
1097 SetValue(UpFocusableViewProperty, value);
1098 NotifyPropertyChanged();
1103 /// The down focusable view.<br />
1104 /// This will return null if not set.<br />
1105 /// This will also return null if the specified down focusable view is not on a window.<br />
1107 /// <since_tizen> 3 </since_tizen>
1108 public View DownFocusableView
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(DownFocusableViewProperty);
1117 SetValue(DownFocusableViewProperty, value);
1118 NotifyPropertyChanged();
1123 /// The clockwise focusable view by rotary wheel.<br />
1124 /// This will return null if not set.<br />
1125 /// This will also return null if the specified clockwise focusable view is not on a window.<br />
1127 [EditorBrowsable(EditorBrowsableState.Never)]
1128 public View ClockwiseFocusableView
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(ClockwiseFocusableViewProperty);
1137 SetValue(ClockwiseFocusableViewProperty, value);
1138 NotifyPropertyChanged();
1143 /// The counter 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 counter clockwise focusable view is not on a window.<br />
1147 [EditorBrowsable(EditorBrowsableState.Never)]
1148 public View CounterClockwiseFocusableView
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(CounterClockwiseFocusableViewProperty);
1157 SetValue(CounterClockwiseFocusableViewProperty, value);
1158 NotifyPropertyChanged();
1163 /// Whether the view should be focusable by keyboard navigation.
1165 /// <since_tizen> 3 </since_tizen>
1166 public bool Focusable
1170 SetValue(FocusableProperty, value);
1171 NotifyPropertyChanged();
1175 return (bool)GetValue(FocusableProperty);
1180 /// 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.
1181 /// Note : Default value is true.
1183 [EditorBrowsable(EditorBrowsableState.Never)]
1184 public bool FocusableChildren
1188 SetValue(FocusableChildrenProperty, value);
1189 NotifyPropertyChanged();
1193 return (bool)GetValue(FocusableChildrenProperty);
1198 /// Whether this view can focus by touch.
1199 /// If Focusable is false, FocusableInTouch is disabled.
1200 /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
1202 [EditorBrowsable(EditorBrowsableState.Never)]
1203 public bool FocusableInTouch
1207 SetValue(FocusableInTouchProperty, value);
1208 NotifyPropertyChanged();
1212 return (bool)GetValue(FocusableInTouchProperty);
1217 /// Retrieves the position of the view.
1218 /// The coordinates are relative to the view's parent.
1221 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1222 /// 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).
1223 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1224 /// and users can get the current actual values through them.
1226 /// <since_tizen> 3 </since_tizen>
1227 public Position CurrentPosition
1231 return GetCurrentPosition();
1236 /// Sets the size of a view for the width and the height.<br />
1237 /// Geometry can be scaled to fit within this area.<br />
1238 /// This does not interfere with the view's scale factor.<br />
1239 /// The views default depth is the minimum of width and height.<br />
1242 /// The property cascade chaining set is not recommended.
1245 /// This way is recommended for setting the property
1247 /// var view = new View();
1248 /// view.Size2D = new Size2D(100, 200);
1250 /// This way to set the property is prohibited
1252 /// view.Size2D.Width = 100; //This does not guarantee a proper operation
1255 /// <since_tizen> 3 </since_tizen>
1256 public Size2D Size2D
1260 #if NUI_PROPERTY_CHANGE_DEBUG
1264 var temp = (Size2D)GetValue(Size2DProperty);
1266 if (this.Layout == null)
1268 if (temp.Width < 0) { temp.Width = 0; }
1269 if (temp.Height < 0) { temp.Height = 0; }
1276 #if NUI_PROPERTY_CHANGE_DEBUG
1280 SetValue(Size2DProperty, value);
1282 NotifyPropertyChanged();
1287 /// Retrieves the size of the view.
1288 /// The coordinates are relative to the view's parent.
1291 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1292 /// 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).
1293 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1294 /// and users can get the current actual values through them.
1296 /// <since_tizen> 3 </since_tizen>
1297 public Size2D CurrentSize
1301 return GetCurrentSize();
1306 /// Retrieves and sets the view's opacity.<br />
1310 /// Animatable - This property can be animated using <c>Animation</c> class.
1312 /// animation.AnimateTo(view, "Opacity", 0.5f);
1316 /// <since_tizen> 3 </since_tizen>
1317 public float Opacity
1321 return (float)GetValue(OpacityProperty);
1325 SetValue(OpacityProperty, value);
1326 NotifyPropertyChanged();
1331 /// Sets the position of the view for X and Y.<br />
1332 /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1333 /// If the position inheritance is disabled, sets the world position.<br />
1336 /// The property cascade chaining set is not recommended.
1339 /// This way is recommended for setting the property
1341 /// var view = new View();
1342 /// view.Position2D = new Position2D(100, 200);
1344 /// This way to set the property is prohibited
1346 /// view.Position2D.X = 100; //This does not guarantee a proper operation
1349 /// <since_tizen> 3 </since_tizen>
1350 public Position2D Position2D
1354 #if NUI_PROPERTY_CHANGE_DEBUG
1358 return (Position2D)GetValue(Position2DProperty);
1362 #if NUI_PROPERTY_CHANGE_DEBUG
1366 SetValue(Position2DProperty, value);
1367 NotifyPropertyChanged();
1372 /// Retrieves the screen position of the view.<br />
1374 /// <since_tizen> 3 </since_tizen>
1375 public Vector2 ScreenPosition
1379 Vector2 temp = new Vector2(0.0f, 0.0f);
1380 var pValue = GetProperty(View.Property.ScreenPosition);
1388 /// Determines whether the pivot point should be used to determine the position of the view.
1389 /// This is false by default.
1391 /// <remarks>If false, then the top-left of the view is used for the position.
1392 /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1394 /// <since_tizen> 3 </since_tizen>
1395 public bool PositionUsesPivotPoint
1399 return (bool)GetValue(PositionUsesPivotPointProperty);
1403 SetValue(PositionUsesPivotPointProperty, value);
1404 NotifyPropertyChanged();
1409 /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead.
1411 /// <since_tizen> 3 </since_tizen>
1412 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PositionUsesPivotPoint instead. " +
1414 "View view = new View(); " +
1415 "view.PivotPoint = PivotPoint.Center; " +
1416 "view.PositionUsesPivotPoint = true;" +
1417 " This has been deprecated in API5 and will be removed in API8")]
1418 [EditorBrowsable(EditorBrowsableState.Never)]
1419 public bool PositionUsesAnchorPoint
1423 return (bool)GetValue(PositionUsesAnchorPointProperty);
1427 SetValue(PositionUsesAnchorPointProperty, value);
1431 private bool InternalPositionUsesAnchorPoint
1436 var pValue = GetProperty(View.Property.PositionUsesAnchorPoint);
1437 pValue.Get(out temp);
1443 var temp = new Tizen.NUI.PropertyValue(value);
1444 SetProperty(View.Property.PositionUsesAnchorPoint, temp);
1446 NotifyPropertyChanged();
1451 /// Queries whether the view is connected to the stage.<br />
1452 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1454 /// <since_tizen> 3 </since_tizen>
1455 public bool IsOnWindow
1464 /// Gets the depth in the hierarchy for the view.
1466 /// <since_tizen> 3 </since_tizen>
1467 public int HierarchyDepth
1471 return GetHierarchyDepth();
1476 /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1479 /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1480 /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1481 /// The values set by this property will likely change.
1483 /// <since_tizen> 3 </since_tizen>
1484 public int SiblingOrder
1488 return (int)GetValue(SiblingOrderProperty);
1492 SetValue(SiblingOrderProperty, value);
1494 Layout?.ChangeLayoutSiblingOrder(value);
1496 NotifyPropertyChanged();
1501 /// Returns the natural size of the view.
1504 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1506 /// <since_tizen> 5 </since_tizen>
1507 public Vector3 NaturalSize
1511 Vector3 ret = GetNaturalSize();
1512 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1518 /// Returns the natural size (Size2D) of the view.
1521 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1523 /// <since_tizen> 4 </since_tizen>
1524 public Size2D NaturalSize2D
1528 Vector3 temp = GetNaturalSize();
1529 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1531 Size2D sz = new Size2D((int)temp.Width, (int)temp.Height);
1538 /// Gets or sets the origin of a view within its parent's area.<br />
1539 /// 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 />
1540 /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1541 /// A view's position is the distance between this origin and the view's anchor-point.<br />
1543 /// <pre>The view has been initialized.</pre>
1544 /// <since_tizen> 3 </since_tizen>
1545 public Position ParentOrigin
1549 Position tmp = (Position)GetValue(ParentOriginProperty);
1550 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1554 SetValue(ParentOriginProperty, value);
1555 NotifyPropertyChanged();
1560 /// Gets or sets the anchor-point of a view.<br />
1561 /// 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 />
1562 /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1563 /// A view position is the distance between its parent-origin and this anchor-point.<br />
1564 /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1565 /// <pre>The view has been initialized.</pre>
1568 /// The property cascade chaining set is not recommended.
1571 /// This way is recommended for setting the property
1573 /// var view = new View();
1574 /// view.PivotPoint = PivotPoint.Center;
1576 /// This way to set the property is prohibited
1578 /// view.PivotPoint.X = 0.5f; //This does not guarantee a proper operation
1581 /// <since_tizen> 3 </since_tizen>
1582 public Position PivotPoint
1586 return (Position)GetValue(PivotPointProperty);
1590 SetValue(PivotPointProperty, value);
1591 NotifyPropertyChanged();
1596 /// Gets or sets the size width of the view.
1600 /// Animatable - This property can be animated using <c>Animation</c> class.
1602 /// animation.AnimateTo(view, "SizeWidth", 500.0f);
1606 /// <since_tizen> 3 </since_tizen>
1607 public float SizeWidth
1611 #if NUI_PROPERTY_CHANGE_DEBUG
1615 return (float)GetValue(SizeWidthProperty);
1619 #if NUI_PROPERTY_CHANGE_DEBUG
1623 SetValue(SizeWidthProperty, value);
1624 NotifyPropertyChanged();
1629 /// Gets or sets the size height of the view.
1633 /// Animatable - This property can be animated using <c>Animation</c> class.
1636 /// animation.AnimateTo(view, "SizeHeight", 500.0f);
1639 /// <since_tizen> 3 </since_tizen>
1640 public float SizeHeight
1644 #if NUI_PROPERTY_CHANGE_DEBUG
1648 return (float)GetValue(SizeHeightProperty);
1652 #if NUI_PROPERTY_CHANGE_DEBUG
1656 SetValue(SizeHeightProperty, value);
1657 NotifyPropertyChanged();
1662 /// Gets or sets the position of the view.<br />
1663 /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1664 /// If the position inheritance is disabled, sets the world position.<br />
1668 /// Animatable - This property can be animated using <c>Animation</c> class.
1670 /// animation.AnimateTo(view, "Position", new Position(50, 0));
1673 /// The property cascade chaining set is not recommended.
1676 /// This way is recommended for setting the property
1678 /// var view = new View();
1679 /// view.Position = new Position(100, 200.5f, 0);
1681 /// This way to set the property is prohibited
1683 /// view.Position.Y = 200.5f; //This does not guarantee a proper operation
1686 /// <since_tizen> 3 </since_tizen>
1687 public Position Position
1691 #if NUI_PROPERTY_CHANGE_DEBUG
1695 return (Position)GetValue(PositionProperty);
1699 #if NUI_PROPERTY_CHANGE_DEBUG
1703 SetValue(PositionProperty, value);
1704 NotifyPropertyChanged();
1709 /// Gets or sets the position X of the view.
1713 /// Animatable - This property can be animated using <c>Animation</c> class.
1715 /// animation.AnimateTo(view, "PositionX", 50.0f);
1719 /// <since_tizen> 3 </since_tizen>
1720 public float PositionX
1724 #if NUI_PROPERTY_CHANGE_DEBUG
1727 return (float)GetValue(PositionXProperty);
1731 #if NUI_PROPERTY_CHANGE_DEBUG
1734 SetValue(PositionXProperty, value);
1735 NotifyPropertyChanged();
1740 /// Gets or sets the position Y of the view.
1744 /// Animatable - This property can be animated using <c>Animation</c> class.
1746 /// animation.AnimateTo(view, "PositionY", 50.0f);
1750 /// <since_tizen> 3 </since_tizen>
1751 public float PositionY
1755 #if NUI_PROPERTY_CHANGE_DEBUG
1758 return (float)GetValue(PositionYProperty);
1762 #if NUI_PROPERTY_CHANGE_DEBUG
1765 SetValue(PositionYProperty, value);
1766 NotifyPropertyChanged();
1771 /// Gets or sets the position Z of the view.
1775 /// Animatable - This property can be animated using <c>Animation</c> class.
1777 /// animation.AnimateTo(view, "PositionZ", 50.0f);
1781 /// <since_tizen> 3 </since_tizen>
1782 public float PositionZ
1786 #if NUI_PROPERTY_CHANGE_DEBUG
1790 return (float)GetValue(PositionZProperty);
1794 #if NUI_PROPERTY_CHANGE_DEBUG
1798 SetValue(PositionZProperty, value);
1799 NotifyPropertyChanged();
1804 /// Gets or sets the world position of the view.
1806 /// <since_tizen> 3 </since_tizen>
1807 public Vector3 WorldPosition
1811 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1812 var pValue = GetProperty(View.Property.WorldPosition);
1820 /// Gets or sets the orientation of the view.<br />
1821 /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1825 /// This is an asynchronous method.
1828 /// Animatable - This property can be animated using <c>Animation</c> class.
1830 /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
1834 /// <since_tizen> 3 </since_tizen>
1835 public Rotation Orientation
1839 return (Rotation)GetValue(OrientationProperty);
1843 SetValue(OrientationProperty, value);
1844 NotifyPropertyChanged();
1849 /// Gets or sets the world orientation of the view.<br />
1851 /// <since_tizen> 3 </since_tizen>
1852 public Rotation WorldOrientation
1856 Rotation temp = new Rotation();
1857 var pValue = GetProperty(View.Property.WorldOrientation);
1865 /// Gets or sets the scale factor applied to the view.<br />
1869 /// Animatable - This property can be animated using <c>Animation</c> class.
1871 /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
1874 /// The property cascade chaining set is not recommended.
1877 /// This way is recommended for setting the property
1879 /// var view = new View();
1880 /// view.Scale = new Vector3(1.5f, 2.0f, 1.0f);
1882 /// This way to set the property is prohibited
1884 /// view.Scale.Width = 1.5f; //This does not guarantee a proper operation
1887 /// <since_tizen> 3 </since_tizen>
1888 public Vector3 Scale
1892 return (Vector3)GetValue(ScaleProperty);
1896 SetValue(ScaleProperty, value);
1897 NotifyPropertyChanged();
1902 /// Gets or sets the scale X factor applied to the view.
1906 /// Animatable - This property can be animated using <c>Animation</c> class.
1908 /// animation.AnimateTo(view, "ScaleX", 1.5f);
1912 /// <since_tizen> 3 </since_tizen>
1917 return (float)GetValue(ScaleXProperty);
1921 SetValue(ScaleXProperty, value);
1922 NotifyPropertyChanged();
1927 /// Gets or sets the scale Y factor applied to the view.
1931 /// Animatable - This property can be animated using <c>Animation</c> class.
1933 /// animation.AnimateTo(view, "ScaleY", 1.5f);
1937 /// <since_tizen> 3 </since_tizen>
1942 return (float)GetValue(ScaleYProperty);
1946 SetValue(ScaleYProperty, value);
1947 NotifyPropertyChanged();
1952 /// Gets or sets the scale Z factor applied to the view.
1956 /// Animatable - This property can be animated using <c>Animation</c> class.
1958 /// animation.AnimateTo(view, "ScaleZ", 1.5f);
1962 /// <since_tizen> 3 </since_tizen>
1967 return (float)GetValue(ScaleZProperty);
1971 SetValue(ScaleZProperty, value);
1972 NotifyPropertyChanged();
1977 /// Gets the world scale of the view.
1979 /// <since_tizen> 3 </since_tizen>
1980 public Vector3 WorldScale
1984 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1985 var pValue = GetProperty(View.Property.WorldScale);
1993 /// Retrieves the visibility flag of the view.
1997 /// If the view is not visible, then the view and its children will not be rendered.
1998 /// 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.
2001 /// Animatable - This property can be animated using <c>Animation</c> class.
2003 /// animation.AnimateTo(view, "Visibility", false);
2007 /// <since_tizen> 3 </since_tizen>
2008 public bool Visibility
2013 var pValue = GetProperty(View.Property.VISIBLE);
2014 pValue.Get(out temp);
2021 /// Gets the view's world color.
2023 /// <since_tizen> 3 </since_tizen>
2024 public Vector4 WorldColor
2028 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
2029 var pValue = GetProperty(View.Property.WorldColor);
2037 /// Gets or sets the view's name.
2039 /// <since_tizen> 3 </since_tizen>
2044 return (string)GetValue(NameProperty);
2048 SetValue(NameProperty, value);
2049 NotifyPropertyChanged();
2054 /// Get the number of children held by the view.
2056 /// <since_tizen> 3 </since_tizen>
2057 public new uint ChildCount
2061 return Convert.ToUInt32(Children.Count);
2066 /// Gets the view's ID.
2069 /// <since_tizen> 3 </since_tizen>
2079 /// Gets or sets the status of whether the view should emit touch or hover signals.
2080 /// If a View is made insensitive, then the View and its children are not hittable.
2082 /// <since_tizen> 3 </since_tizen>
2083 public bool Sensitive
2087 return (bool)GetValue(SensitiveProperty);
2091 SetValue(SensitiveProperty, value);
2092 NotifyPropertyChanged();
2097 /// Gets or sets the status of whether the view should be enabled user interactions.
2098 /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled.
2100 /// <since_tizen> tizen_next </since_tizen>
2101 [EditorBrowsable(EditorBrowsableState.Never)]
2102 public bool IsEnabled
2106 return (bool)GetValue(IsEnabledProperty);
2110 SetValue(IsEnabledProperty, value);
2111 NotifyPropertyChanged();
2116 /// 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.
2118 /// <since_tizen> 3 </since_tizen>
2119 public bool LeaveRequired
2123 return (bool)GetValue(LeaveRequiredProperty);
2127 SetValue(LeaveRequiredProperty, value);
2128 NotifyPropertyChanged();
2133 /// Gets or sets the status of whether a child view inherits it's parent's orientation.
2135 /// <since_tizen> 3 </since_tizen>
2136 public bool InheritOrientation
2140 return (bool)GetValue(InheritOrientationProperty);
2144 SetValue(InheritOrientationProperty, value);
2145 NotifyPropertyChanged();
2150 /// Gets or sets the status of whether a child view inherits it's parent's scale.
2152 /// <since_tizen> 3 </since_tizen>
2153 public bool InheritScale
2157 return (bool)GetValue(InheritScaleProperty);
2161 SetValue(InheritScaleProperty, value);
2162 NotifyPropertyChanged();
2167 /// Gets or sets the status of how the view and its children should be drawn.<br />
2168 /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
2169 /// 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 />
2170 /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
2171 /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
2172 /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
2174 /// <since_tizen> 3 </since_tizen>
2175 public DrawModeType DrawMode
2179 return (DrawModeType)GetValue(DrawModeProperty);
2183 SetValue(DrawModeProperty, value);
2184 NotifyPropertyChanged();
2189 /// Gets or sets the relative to parent size factor of the view.<br />
2190 /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
2191 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
2194 /// The property cascade chaining set is not recommended.
2197 /// This way is recommended for setting the property
2199 /// var text = new TextField();
2200 /// text.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
2202 /// This way to set the property is prohibited
2204 /// text.SizeModeFactor.Width = 1.0f; //This does not guarantee a proper operation
2207 /// <since_tizen> 3 </since_tizen>
2208 public Vector3 SizeModeFactor
2212 return (Vector3)GetValue(SizeModeFactorProperty);
2216 SetValue(SizeModeFactorProperty, value);
2217 NotifyPropertyChanged();
2222 /// Gets or sets the width resize policy to be used.
2224 /// <since_tizen> 3 </since_tizen>
2225 public ResizePolicyType WidthResizePolicy
2229 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
2233 SetValue(WidthResizePolicyProperty, value);
2234 NotifyPropertyChanged();
2239 /// Gets or sets the height resize policy to be used.
2241 /// <since_tizen> 3 </since_tizen>
2242 public ResizePolicyType HeightResizePolicy
2246 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
2250 SetValue(HeightResizePolicyProperty, value);
2251 NotifyPropertyChanged();
2256 /// Gets or sets the policy to use when setting size with size negotiation.<br />
2257 /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
2259 /// <since_tizen> 3 </since_tizen>
2260 public SizeScalePolicyType SizeScalePolicy
2264 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
2268 SetValue(SizeScalePolicyProperty, value);
2269 NotifyPropertyChanged();
2274 /// Gets or sets the status of whether the width size is dependent on the height size.
2276 /// <since_tizen> 3 </since_tizen>
2277 public bool WidthForHeight
2281 return (bool)GetValue(WidthForHeightProperty);
2285 SetValue(WidthForHeightProperty, value);
2286 NotifyPropertyChanged();
2291 /// Gets or sets the status of whether the height size is dependent on the width size.
2293 /// <since_tizen> 3 </since_tizen>
2294 public bool HeightForWidth
2298 return (bool)GetValue(HeightForWidthProperty);
2302 SetValue(HeightForWidthProperty, value);
2303 NotifyPropertyChanged();
2308 /// Gets or sets the padding for use in layout.
2311 /// The property cascade chaining set is not recommended.
2314 /// This way is recommended for setting the property
2316 /// var view = new View();
2317 /// view.Padding = new Extents(5, 5, 5, 5);
2319 /// This way to set the property is prohibited
2321 /// view.Padding.Start = 5; //This does not guarantee a proper operation
2324 /// <since_tizen> 5 </since_tizen>
2325 public Extents Padding
2329 return (Extents)GetValue(PaddingProperty);
2333 SetValue(PaddingProperty, value);
2334 NotifyPropertyChanged();
2339 /// Gets or sets the minimum size the view can be assigned in size negotiation.
2341 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2343 /// The property cascade chaining set is not recommended.
2346 /// This way is recommended for setting the property
2348 /// var view = new View();
2349 /// view.MinimumSize = new Size2D(100, 200);
2351 /// This way to set the property is prohibited
2353 /// view.MinimumSize.Width = 100; //This does not guarantee a proper operation
2356 /// <since_tizen> 3 </since_tizen>
2357 public Size2D MinimumSize
2361 #if NUI_PROPERTY_CHANGE_DEBUG
2362 MinimumSizeGetter++;
2364 return (Size2D)GetValue(MinimumSizeProperty);
2368 #if NUI_PROPERTY_CHANGE_DEBUG
2369 MinimumSizeSetter++;
2373 throw new ArgumentNullException(nameof(value));
2377 // Note: it only works if minimum size is >= than natural size.
2378 // To force the size it should be done through the width&height spec or Size2D.
2379 layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
2380 layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
2381 layout.RequestLayout();
2383 SetValue(MinimumSizeProperty, value);
2384 NotifyPropertyChanged();
2389 /// Gets or sets the maximum size the view can be assigned in size negotiation.
2392 /// This way is recommended for setting the property
2394 /// var view = new View();
2395 /// view.MaximumSize = new Size2D(100, 200);
2397 /// This way to set the property is prohibited
2399 /// view.MaximumSize.Height = 200; //This does not guarantee a proper operation
2402 /// <since_tizen> 3 </since_tizen>
2403 public Size2D MaximumSize
2407 #if NUI_PROPERTY_CHANGE_DEBUG
2408 MaximumSizeGetter++;
2410 return (Size2D)GetValue(MaximumSizeProperty);
2414 #if NUI_PROPERTY_CHANGE_DEBUG
2415 MaximumSizeSetter++;
2417 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
2418 // MATCH_PARENT spec + parent container size can be used to limit
2421 layout.RequestLayout();
2423 SetValue(MaximumSizeProperty, value);
2424 NotifyPropertyChanged();
2429 /// Gets or sets whether a child view inherits it's parent's position.<br />
2430 /// Default is to inherit.<br />
2431 /// 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 />
2433 /// <since_tizen> 3 </since_tizen>
2434 public bool InheritPosition
2438 return (bool)GetValue(InheritPositionProperty);
2442 SetValue(InheritPositionProperty, value);
2443 NotifyPropertyChanged();
2448 /// Gets or sets the clipping behavior (mode) of it's children.
2450 /// <since_tizen> 3 </since_tizen>
2451 public ClippingModeType ClippingMode
2455 return (ClippingModeType)GetValue(ClippingModeProperty);
2459 SetValue(ClippingModeProperty, value);
2460 NotifyPropertyChanged();
2465 /// Gets the number of renderers held by the view.
2467 /// <since_tizen> 3 </since_tizen>
2468 public uint RendererCount
2472 return GetRendererCount();
2477 /// This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead.
2480 /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2482 /// <since_tizen> 3 </since_tizen>
2483 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead. " +
2485 "View view = new View(); " +
2486 "view.PivotPoint = PivotPoint.Center; " +
2487 "view.PositionUsesPivotPoint = true;")]
2488 [EditorBrowsable(EditorBrowsableState.Never)]
2489 public Position AnchorPoint
2493 return GetValue(AnchorPointProperty) as Position;
2497 SetValue(AnchorPointProperty, value);
2501 private Position InternalAnchorPoint
2505 Position temp = new Position(0.0f, 0.0f, 0.0f);
2506 var pValue = GetProperty(View.Property.AnchorPoint);
2509 Position ret = new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
2515 var temp = new Tizen.NUI.PropertyValue(value);
2516 SetProperty(View.Property.AnchorPoint, temp);
2518 NotifyPropertyChanged();
2523 /// Sets the size of a view for the width, the height and the depth.<br />
2524 /// Geometry can be scaled to fit within this area.<br />
2525 /// This does not interfere with the view's scale factor.<br />
2526 /// The views default depth is the minimum of width and height.<br />
2530 /// Animatable - This property can be animated using <c>Animation</c> class.
2532 /// animation.AnimateTo(view, "Size", new Size(100, 100));
2535 /// The property cascade chaining set is not recommended.
2538 /// This way is recommended for setting the property
2540 /// var view = new View();
2541 /// view.Size = new Size(100.5f, 200, 0);
2543 /// This way to set the property is prohibited
2545 /// view.Size.Width = 100.5f; //This does not guarantee a proper operation
2548 /// <since_tizen> 5 </since_tizen>
2553 #if NUI_PROPERTY_CHANGE_DEBUG
2556 return (Size)GetValue(SizeProperty);
2560 #if NUI_PROPERTY_CHANGE_DEBUG
2563 SetValue(SizeProperty, value);
2564 NotifyPropertyChanged();
2569 /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead.
2571 /// <since_tizen> 3 </since_tizen>
2572 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. " +
2574 "Container parent = view.GetParent(); " +
2575 "View view = parent as View;")]
2576 [EditorBrowsable(EditorBrowsableState.Never)]
2577 public new View Parent
2582 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2583 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2584 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2586 if (basehandle is Layer layer)
2588 ret = new View(Layer.getCPtr(layer).Handle, false);
2589 NUILog.Error("This Parent property is deprecated, should do not be used");
2593 ret = basehandle as View;
2596 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2597 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2599 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2605 /// Gets/Sets whether inherit parent's the layout Direction.
2607 /// <since_tizen> 4 </since_tizen>
2608 public bool InheritLayoutDirection
2612 return (bool)GetValue(InheritLayoutDirectionProperty);
2616 SetValue(InheritLayoutDirectionProperty, value);
2617 NotifyPropertyChanged();
2622 /// Gets/Sets the layout Direction.
2624 /// <since_tizen> 4 </since_tizen>
2625 public ViewLayoutDirectionType LayoutDirection
2629 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2633 SetValue(LayoutDirectionProperty, value);
2634 NotifyPropertyChanged();
2635 layout?.RequestLayout();
2640 /// Gets or sets the Margin for use in layout.
2643 /// Margin property is supported by Layout algorithms and containers.
2644 /// Please Set Layout if you want to use Margin property.
2645 /// The property cascade chaining set is not recommended.
2648 /// This way is recommended for setting the property
2650 /// var view = new View();
2651 /// view.Margin = new Extents(10, 5, 15, 20);
2653 /// This way to set the property is prohibited
2655 /// view.Margin.Top = 15; //This does not guarantee a proper operation
2658 /// <since_tizen> 4 </since_tizen>
2659 public Extents Margin
2663 return (Extents)GetValue(MarginProperty);
2667 SetValue(MarginProperty, value);
2668 NotifyPropertyChanged();
2673 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2677 /// // matchParentView matches its size to its parent size.
2678 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2679 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2681 /// // wrapContentView wraps its children with their desired size.
2682 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2683 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2685 /// // exactSizeView shows itself with an exact size.
2686 /// exactSizeView.WidthSpecification = 100;
2687 /// exactSizeView.HeightSpecification = 100;
2690 /// <since_tizen> 6 </since_tizen>
2691 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2692 public int WidthSpecification
2696 return (int)GetValue(WidthSpecificationProperty);
2700 SetValue(WidthSpecificationProperty, value);
2701 NotifyPropertyChanged();
2705 private int InternalWidthSpecification
2713 if (value == widthPolicy)
2716 widthPolicy = value;
2717 if (widthPolicy >= 0)
2719 if (heightPolicy >= 0) // Policy an exact value
2721 // Create Size2D only both _widthPolicy and _heightPolicy are set.
2722 Size2D = new Size2D(widthPolicy, heightPolicy);
2725 layout?.RequestLayout();
2730 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2734 /// // matchParentView matches its size to its parent size.
2735 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2736 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2738 /// // wrapContentView wraps its children with their desired size.
2739 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2740 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2742 /// // exactSizeView shows itself with an exact size.
2743 /// exactSizeView.WidthSpecification = 100;
2744 /// exactSizeView.HeightSpecification = 100;
2747 /// <since_tizen> 6 </since_tizen>
2748 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2749 public int HeightSpecification
2753 return (int)GetValue(HeightSpecificationProperty);
2757 SetValue(HeightSpecificationProperty, value);
2758 NotifyPropertyChanged();
2762 private int InternalHeightSpecification
2766 return heightPolicy;
2770 if (value == heightPolicy)
2773 heightPolicy = value;
2774 if (heightPolicy >= 0)
2776 if (widthPolicy >= 0) // Policy an exact value
2778 // Create Size2D only both _widthPolicy and _heightPolicy are set.
2779 Size2D = new Size2D(widthPolicy, heightPolicy);
2782 layout?.RequestLayout();
2787 /// Gets the List of transitions for this View.
2789 /// <since_tizen> 6 </since_tizen>
2790 public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2794 if (layoutTransitions == null)
2796 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2798 return layoutTransitions;
2803 /// Sets a layout transitions for this View.
2805 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2807 /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2809 /// <since_tizen> 6 </since_tizen>
2810 public LayoutTransition LayoutTransition
2814 return GetValue(LayoutTransitionProperty) as LayoutTransition;
2818 SetValue(LayoutTransitionProperty, value);
2819 NotifyPropertyChanged();
2823 private LayoutTransition InternalLayoutTransition
2827 return layoutTransition;
2833 throw new global::System.ArgumentNullException(nameof(value));
2835 if (layoutTransitions == null)
2837 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2840 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
2842 AttachTransitionsToChildren(value);
2844 layoutTransition = value;
2849 /// This has been deprecated in API5 and will be removed in API8. Use Padding instead.
2852 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2854 /// <since_tizen> 4 </since_tizen>
2855 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use Padding instead.")]
2856 [EditorBrowsable(EditorBrowsableState.Never)]
2857 public Extents PaddingEX
2861 return GetValue(PaddingEXProperty) as Extents;
2865 SetValue(PaddingEXProperty, value);
2869 private Extents InternalPaddingEX
2873 Extents temp = new Extents(0, 0, 0, 0);
2874 var pValue = GetProperty(View.Property.PADDING);
2877 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2883 var temp = new Tizen.NUI.PropertyValue(value);
2884 SetProperty(View.Property.PADDING, temp);
2886 NotifyPropertyChanged();
2887 layout?.RequestLayout();
2892 /// The Color of View. This is an RGBA value.
2893 /// Each RGBA components match as <see cref="ColorRed"/>, <see cref="ColorGreen"/>, <see cref="ColorBlue"/>, and <see cref="Opacity"/>.
2894 /// This property will multiply the final color of this view. (BackgroundColor, BorderlineColor, BackgroundImage, etc).
2895 /// For example, if view.BackgroundColor = Color.Yellow and view.Color = Color.Purple, this view will shown as Red.
2896 /// Inherient of color value depend on <see cref="ColorMode"/>.
2900 /// Animatable - This property can be animated using <c>Animation</c> class.
2902 /// The property cascade chaining set is not recommended.
2905 /// This way is recommended for setting the property
2907 /// var view = new View();
2908 /// view.Color = new Color(0.5f, 0.2f, 0.1f, 0.5f);
2910 /// This way to set the property is prohibited
2912 /// view.Color.A = 0.5f; //This does not guarantee a proper operation
2915 [EditorBrowsable(EditorBrowsableState.Never)]
2920 return (Color)GetValue(ColorProperty);
2924 SetValue(ColorProperty, value);
2925 NotifyPropertyChanged();
2930 /// The Red component of View.Color.
2934 /// Animatable - This property can be animated using <c>Animation</c> class.
2937 [EditorBrowsable(EditorBrowsableState.Never)]
2938 public float ColorRed
2942 return (float)GetValue(ColorRedProperty);
2946 SetValue(ColorRedProperty, value);
2947 NotifyPropertyChanged();
2952 /// The Green component of View.Color.
2956 /// Animatable - This property can be animated using <c>Animation</c> class.
2959 [EditorBrowsable(EditorBrowsableState.Never)]
2960 public float ColorGreen
2964 return (float)GetValue(ColorGreenProperty);
2968 SetValue(ColorGreenProperty, value);
2969 NotifyPropertyChanged();
2974 /// The Blue component of View.Color.
2978 /// Animatable - This property can be animated using <c>Animation</c> class.
2981 [EditorBrowsable(EditorBrowsableState.Never)]
2982 public float ColorBlue
2986 return (float)GetValue(ColorBlueProperty);
2990 SetValue(ColorBlueProperty, value);
2991 NotifyPropertyChanged();
2996 /// Set the layout on this View. Replaces any existing Layout.
2999 /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
3001 /// <since_tizen> 6 </since_tizen>
3002 public LayoutItem Layout
3006 return GetValue(LayoutProperty) as LayoutItem;
3010 SetValue(LayoutProperty, value);
3014 private LayoutItem InternalLayout
3022 // Do nothing if layout provided is already set on this View.
3023 if (value == layout)
3028 LayoutingDisabled = false;
3031 // If new layout being set already has a owner then that owner receives a replacement default layout.
3032 // First check if the layout to be set already has a owner.
3033 if (value?.Owner != null)
3035 // Previous owner of the layout gets a default layout as a replacement.
3036 value.Owner.Layout = new AbsoluteLayout()
3038 // Copy Margin and Padding to replacement LayoutGroup.
3039 Margin = value.Margin,
3040 Padding = value.Padding,
3044 // Copy Margin and Padding to new layout being set or restore padding and margin back to
3045 // View if no replacement. Previously margin and padding values would have been moved from
3046 // the View to the layout.
3047 if (layout != null) // Existing layout
3051 // Existing layout being replaced so copy over margin and padding values.
3052 value.Margin = layout.Margin;
3053 value.Padding = layout.Padding;
3054 value.SetPositionByLayout = !excludeLayouting;
3058 // Layout not being replaced so restore margin and padding to View.
3059 SetValue(MarginProperty, layout.Margin);
3060 SetValue(PaddingProperty, layout.Padding);
3061 NotifyPropertyChanged();
3066 // First Layout to be added to the View hence copy
3068 // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
3071 Extents margin = Margin;
3072 Extents padding = Padding;
3073 bool setMargin = false;
3074 bool setPadding = false;
3076 if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
3078 // If View already has a margin set then store it in Layout instead.
3079 value.Margin = margin;
3080 SetValue(MarginProperty, new Extents(0, 0, 0, 0));
3084 if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
3086 // If View already has a padding set then store it in Layout instead.
3087 value.Padding = padding;
3088 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
3092 if (setMargin || setPadding)
3094 NotifyPropertyChanged();
3097 value.SetPositionByLayout = !excludeLayouting;
3101 // Remove existing layout from it's parent layout group.
3104 // Set layout to this view
3110 /// The weight of the View, used to share available space in a layout with siblings.
3112 /// <since_tizen> 6 </since_tizen>
3122 layout?.RequestLayout();
3127 /// Whether to load the BackgroundImage synchronously.
3128 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3129 /// Note: For Normal Quad images only.
3131 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
3132 [EditorBrowsable(EditorBrowsableState.Never)]
3133 public bool BackgroundImageSynchronosLoading
3137 return (bool)GetValue(BackgroundImageSynchronosLoadingProperty);
3141 SetValue(BackgroundImageSynchronosLoadingProperty, value);
3142 NotifyPropertyChanged();
3146 private bool InternalBackgroundImageSynchronosLoading
3150 return BackgroundImageSynchronousLoading;
3154 BackgroundImageSynchronousLoading = value;
3159 /// Whether to load the BackgroundImage synchronously.
3160 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3161 /// Note: For Normal Quad images only.
3163 /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3164 [EditorBrowsable(EditorBrowsableState.Never)]
3165 public bool BackgroundImageSynchronousLoading
3169 return (bool)GetValue(BackgroundImageSynchronousLoadingProperty);
3173 SetValue(BackgroundImageSynchronousLoadingProperty, value);
3174 NotifyPropertyChanged();
3178 private bool InternalBackgroundImageSynchronousLoading
3182 return backgroundImageSynchronousLoading;
3186 backgroundImageSynchronousLoading = value;
3188 string bgUrl = null;
3189 var pValue = Background.Find(ImageVisualProperty.URL);
3190 pValue?.Get(out bgUrl);
3193 if (!string.IsNullOrEmpty(bgUrl))
3195 PropertyMap bgMap = this.Background;
3196 var temp = new PropertyValue(backgroundImageSynchronousLoading);
3197 bgMap[ImageVisualProperty.SynchronousLoading] = temp;
3204 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3205 [EditorBrowsable(EditorBrowsableState.Never)]
3206 public Vector4 UpdateAreaHint
3210 return (Vector4)GetValue(UpdateAreaHintProperty);
3214 SetValue(UpdateAreaHintProperty, value);
3215 NotifyPropertyChanged();
3220 /// Enable/Disable ControlState propagation for children.
3221 /// It is false by default.
3222 /// If the View needs to share ControlState with descendants, please set it true.
3223 /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
3225 [EditorBrowsable(EditorBrowsableState.Never)]
3226 public bool EnableControlStatePropagation
3230 return (bool)GetValue(EnableControlStatePropagationProperty);
3234 SetValue(EnableControlStatePropagationProperty, value);
3235 NotifyPropertyChanged();
3239 private bool InternalEnableControlStatePropagation
3241 get => themeData?.ControlStatePropagation ?? false;
3244 if (InternalEnableControlStatePropagation == value) return;
3246 if (themeData == null) themeData = new ThemeData();
3248 themeData.ControlStatePropagation = value;
3250 foreach (View child in Children)
3252 child.EnableControlStatePropagation = value;
3258 /// The ControlStates can propagate from the parent.
3259 /// Listed ControlStates will be accepted propagation of the parent ControlState changes
3260 /// if parent view EnableControlState is true.
3261 /// <see cref="EnableControlState"/>.
3262 /// Default is ControlState.All, so every ControlStates will be propagated from the parent.
3264 [EditorBrowsable(EditorBrowsableState.Never)]
3265 public ControlState PropagatableControlStates
3269 return (ControlState)GetValue(PropagatableControlStatesProperty);
3273 SetValue(PropagatableControlStatesProperty, value);
3274 NotifyPropertyChanged();
3278 private ControlState InternalPropagatableControlStates
3280 get => propagatableControlStates;
3281 set => propagatableControlStates = value;
3285 /// By default, it is false in View, true in Control.
3286 /// Note that if the value is true, the View will be a touch receptor.
3288 [EditorBrowsable(EditorBrowsableState.Never)]
3289 public bool EnableControlState
3293 return (bool)GetValue(EnableControlStateProperty);
3297 SetValue(EnableControlStateProperty, value);
3302 /// Whether the actor grab all touches even if touch leaves its boundary.
3304 /// <returns>true, if it grab all touch after start</returns>
3305 [EditorBrowsable(EditorBrowsableState.Never)]
3306 public bool GrabTouchAfterLeave
3310 return (bool)GetValue(GrabTouchAfterLeaveProperty);
3314 SetValue(GrabTouchAfterLeaveProperty, value);
3318 private bool InternalGrabTouchAfterLeave
3323 var pValue = GetProperty(View.Property.CaptureAllTouchAfterStart);
3324 pValue.Get(out temp);
3330 var temp = new Tizen.NUI.PropertyValue(value);
3331 SetProperty(View.Property.CaptureAllTouchAfterStart, temp);
3333 NotifyPropertyChanged();
3338 /// Whether the view will only receive own touch.
3340 /// <returns>true, if it only receives touches that started from itself.</returns>
3341 [EditorBrowsable(EditorBrowsableState.Never)]
3342 public bool AllowOnlyOwnTouch
3346 return (bool)GetValue(AllowOnlyOwnTouchProperty);
3350 SetValue(AllowOnlyOwnTouchProperty, value);
3354 private bool InternalAllowOnlyOwnTouch
3359 var pValue = GetProperty(View.Property.AllowOnlyOwnTouch);
3360 pValue.Get(out temp);
3366 var temp = new Tizen.NUI.PropertyValue(value);
3367 SetProperty(View.Property.AllowOnlyOwnTouch, temp);
3369 NotifyPropertyChanged();
3374 /// Determines which blend equation will be used to render renderers of this actor.
3376 /// <returns>blend equation enum currently assigned</returns>
3377 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
3378 [EditorBrowsable(EditorBrowsableState.Never)]
3379 public BlendEquationType BlendEquation
3383 return (BlendEquationType)GetValue(BlendEquationProperty);
3387 SetValue(BlendEquationProperty, value);
3391 private BlendEquationType InternalBlendEquation
3396 var pValue = GetProperty(View.Property.BlendEquation);
3397 pValue.Get(out temp);
3399 return (BlendEquationType)temp;
3403 var temp = new Tizen.NUI.PropertyValue((int)value);
3404 SetProperty(View.Property.BlendEquation, temp);
3406 NotifyPropertyChanged();
3411 /// If the value is true, the View will change its style as the theme changes.
3412 /// The default value is false in normal case but it can be true when the NUIApplication is created with <see cref="NUIApplication.ThemeOptions.ThemeChangeSensitive"/>.
3414 /// <since_tizen> 9 </since_tizen>
3415 public bool ThemeChangeSensitive
3417 get => (bool)GetValue(ThemeChangeSensitiveProperty);
3418 set => SetValue(ThemeChangeSensitiveProperty, value);
3422 /// Create Style, it is abstract function and must be override.
3424 [EditorBrowsable(EditorBrowsableState.Never)]
3425 protected virtual ViewStyle CreateViewStyle()
3427 return new ViewStyle();
3431 /// Called after the View's ControlStates changed.
3433 /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
3434 [EditorBrowsable(EditorBrowsableState.Never)]
3435 protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
3441 [EditorBrowsable(EditorBrowsableState.Never)]
3442 protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
3444 isThemeChanged = true;
3445 if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
3446 else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
3447 isThemeChanged = false;
3451 /// Apply style instance to the view.
3452 /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
3454 /// <since_tizen> 9 </since_tizen>
3455 public virtual void ApplyStyle(ViewStyle viewStyle)
3457 if (viewStyle == null || themeData?.viewStyle == viewStyle) return;
3459 if (themeData == null) themeData = new ThemeData();
3461 themeData.viewStyle = viewStyle;
3463 if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
3469 BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
3471 if (bindablePropertyOfView == null)
3476 var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
3477 viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
3479 foreach (var sourceProperty in dirtyStyleProperties)
3481 var sourceValue = viewStyle.GetValue(sourceProperty);
3483 if (sourceValue == null)
3488 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
3490 // Do not set value again when theme is changed and the value has been set already.
3491 if (isThemeChanged && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty))
3496 if (destinationProperty != null)
3498 InternalSetValue(destinationProperty, sourceValue);
3504 /// Get whether the View is culled or not.
3505 /// True means that the View is out of the view frustum.
3508 /// Hidden-API (Inhouse-API).
3510 [EditorBrowsable(EditorBrowsableState.Never)]
3516 var pValue = GetProperty(View.Property.Culled);
3517 pValue.Get(out temp);
3524 /// Set or Get TransitionOptions for the page transition.
3525 /// This property is used to define how this view will be transitioned during Page switching.
3527 /// <since_tizen> 9 </since_tizen>
3528 public TransitionOptions TransitionOptions
3532 return GetValue(TransitionOptionsProperty) as TransitionOptions;
3536 SetValue(TransitionOptionsProperty, value);
3537 NotifyPropertyChanged();
3541 private TransitionOptions InternalTransitionOptions
3545 transitionOptions = value;
3549 return transitionOptions;
3554 /// Gets or sets the status of whether the view should emit key event signals.
3555 /// If a View's DispatchKeyEvents is set to false, then itself and parents will not receive key event signals.
3557 [EditorBrowsable(EditorBrowsableState.Never)]
3558 public bool DispatchKeyEvents
3562 return (bool)GetValue(DispatchKeyEventsProperty);
3566 SetValue(DispatchKeyEventsProperty, value);
3567 NotifyPropertyChanged();
3572 /// Gets or sets the status of whether touch events can be dispatched.
3573 /// If a View's DispatchTouchEvents is set to false, then it's can not will receive touch and parents will not receive a touch event signal either.
3574 /// This works without adding a TouchEvent callback in the View.
3576 /// If the <see cref="Tizen.NUI.BaseComponents.View.Sensitive"/> is a property that determines whether or not to be hittable, then this property prevents the propagation of the hit touch event.
3579 [EditorBrowsable(EditorBrowsableState.Never)]
3580 public bool DispatchTouchEvents
3584 return dispatchTouchEvents;
3588 if (dispatchTouchEvents != value)
3590 dispatchTouchEvents = value;
3591 if (dispatchTouchEvents == false)
3593 TouchEvent += OnDispatchTouchEvent;
3597 TouchEvent -= OnDispatchTouchEvent;
3603 private bool OnDispatchTouchEvent(object source, View.TouchEventArgs e)
3609 /// Gets or sets the status of whether the view should emit Gesture event signals.
3610 /// If a View's DispatchGestureEvents is set to false, then itself and parents will not receive all gesture event signals.
3611 /// The itself and parents does not receive tap, pinch, pan, rotation, or longpress gestures.
3613 [EditorBrowsable(EditorBrowsableState.Never)]
3614 public bool DispatchGestureEvents
3618 return dispatchGestureEvents;
3622 if (dispatchGestureEvents != value)
3624 dispatchGestureEvents = value;
3625 ConfigGestureDetector(dispatchGestureEvents);
3631 /// Gets or sets the status of whether the view should emit Gesture event signals.
3632 /// If a View's DispatchParentGestureEvents is set to false, then parents will not receive all gesture event signals.
3633 /// The parents does not receive tap, pinch, pan, rotation, or longpress gestures.
3635 [EditorBrowsable(EditorBrowsableState.Never)]
3636 public bool DispatchParentGestureEvents
3640 return dispatchParentGestureEvents;
3644 if (dispatchParentGestureEvents != value)
3646 dispatchParentGestureEvents = value;
3647 ConfigGestureDetector(dispatchParentGestureEvents);
3652 private void ConfigGestureDetector(bool dispatch)
3654 if (panGestureDetector == null) panGestureDetector = new PanGestureDetector();
3655 if (longGestureDetector == null) longGestureDetector = new LongPressGestureDetector();
3656 if (pinchGestureDetector == null) pinchGestureDetector = new PinchGestureDetector();
3657 if (tapGestureDetector == null) tapGestureDetector = new TapGestureDetector();
3658 if (rotationGestureDetector == null) rotationGestureDetector = new RotationGestureDetector();
3660 if (dispatch == true)
3662 configGestureCount = configGestureCount > 0 ? configGestureCount-- : 0;
3663 if (configGestureCount == 0)
3665 panGestureDetector.Detach(this);
3666 longGestureDetector.Detach(this);
3667 pinchGestureDetector.Detach(this);
3668 tapGestureDetector.Detach(this);
3669 rotationGestureDetector.Detach(this);
3671 panGestureDetector.Detected -= OnGestureDetected;
3672 longGestureDetector.Detected -= OnGestureDetected;
3673 pinchGestureDetector.Detected -= OnGestureDetected;
3674 tapGestureDetector.Detected -= OnGestureDetected;
3675 rotationGestureDetector.Detected -= OnGestureDetected;
3677 panGestureDetector = null;
3678 longGestureDetector = null;
3679 pinchGestureDetector = null;
3680 tapGestureDetector = null;
3681 rotationGestureDetector = null;
3686 if (configGestureCount == 0)
3688 panGestureDetector.Attach(this);
3689 longGestureDetector.Attach(this);
3690 pinchGestureDetector.Attach(this);
3691 tapGestureDetector.Attach(this);
3692 rotationGestureDetector.Attach(this);
3694 panGestureDetector.Detected += OnGestureDetected;
3695 longGestureDetector.Detected += OnGestureDetected;
3696 pinchGestureDetector.Detected += OnGestureDetected;
3697 tapGestureDetector.Detected += OnGestureDetected;
3698 rotationGestureDetector.Detected += OnGestureDetected;
3700 configGestureCount++;
3704 private void OnGestureDetected(object source, EventArgs e)
3706 // Does notting. This is to consume the gesture.
3710 /// Called when the view is hit through TouchEvent or GestureEvent.
3711 /// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
3712 /// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
3713 /// User can override whether hit or not in HitTest.
3714 /// You can get the coordinates relative to tthe top-left of the hit view by touch.GetLocalPosition(0).
3715 /// or you can get the coordinates relative to the top-left of the screen by touch.GetScreenPosition(0).
3717 // <param name="touch"><see cref="Tizen.NUI.Touch"/>The touch data</param>
3718 [EditorBrowsable(EditorBrowsableState.Never)]
3719 protected virtual bool HitTest(Touch touch)
3725 /// Retrieve the View's current Color.
3728 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3729 /// 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).
3730 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3731 /// and users can get the current actual values through them.
3733 [EditorBrowsable(EditorBrowsableState.Never)]
3734 public Color CurrentColor => GetCurrentColor();
3737 /// Retrieve the current scale factor applied to the View.
3740 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3741 /// 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).
3742 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3743 /// and users can get the current actual values through them.
3745 [EditorBrowsable(EditorBrowsableState.Never)]
3746 public Vector3 CurrentScale => GetCurrentScale();