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_1
87 private string internalName = string.Empty;
89 #if NUI_PROPERTY_CHANGE_3
90 private Position internalCurrentParentOrigin = null;
91 private Position internalCurrentAnchorPoint = null;
92 private Vector3 internalTargetSize = null;
93 private Size2D internalCurrentSize = null;
94 private Vector3 internalNaturalSize = null;
95 private Position internalCurrentPosition = null;
96 private Vector3 internalCurrentWorldPosition = null;
97 private Vector3 internalCurrentScale = null;
98 private Vector3 internalCurrentWorldScale = null;
99 private Vector4 internalCurrentColor = null;
100 private Vector4 internalCurrentWorldColor = null;
102 #if NUI_VISUAL_PROPERTY_CHANGE_1
103 private Vector2 internalCurrentScreenPosition = null;
108 RegisterPropertyGroup(PositionProperty, positionPropertyGroup);
109 RegisterPropertyGroup(Position2DProperty, positionPropertyGroup);
110 RegisterPropertyGroup(PositionXProperty, positionPropertyGroup);
111 RegisterPropertyGroup(PositionYProperty, positionPropertyGroup);
113 RegisterPropertyGroup(SizeProperty, sizePropertyGroup);
114 RegisterPropertyGroup(Size2DProperty, sizePropertyGroup);
115 RegisterPropertyGroup(SizeWidthProperty, sizePropertyGroup);
116 RegisterPropertyGroup(SizeHeightProperty, sizePropertyGroup);
118 RegisterPropertyGroup(ScaleProperty, scalePropertyGroup);
119 RegisterPropertyGroup(ScaleXProperty, scalePropertyGroup);
120 RegisterPropertyGroup(ScaleYProperty, scalePropertyGroup);
121 RegisterPropertyGroup(ScaleZProperty, scalePropertyGroup);
123 RegisterAccessibilityDelegate();
127 /// Creates a new instance of a view.
129 /// <since_tizen> 3 </since_tizen>
130 public View() : this(Interop.View.New(), true)
132 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
135 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
136 [EditorBrowsable(EditorBrowsableState.Never)]
137 public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
142 /// Create a new instance of a View with setting the status of shown or hidden.
144 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
145 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
146 [EditorBrowsable(EditorBrowsableState.Never)]
147 public View(bool shown) : this(Interop.View.New(), true)
149 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
153 internal View(View uiControl, bool shown = true) : this(Interop.View.NewView(View.getCPtr(uiControl)), true)
155 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
161 backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
164 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
166 InitializeStyle(viewStyle);
169 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn)
173 PositionUsesPivotPoint = false;
176 onWindowSendEventCallback = SendViewAddedEventToWindow;
177 using ViewSignal signal = new ViewSignal(Interop.ActorSignal.ActorOnSceneSignal(SwigCPtr), false);
178 signal?.Connect(onWindowSendEventCallback);
180 hitTestResultDataCallback = OnHitTestResult;
181 using TouchDataSignal touchDataSignal = new TouchDataSignal(Interop.ActorSignal.ActorHitTestResultSignal(SwigCPtr), false);
182 touchDataSignal?.Connect(hitTestResultDataCallback);
189 GrabTouchAfterLeave = defaultGrabTouchAfterLeave;
190 AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch;
193 internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
195 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
204 /// The event that is triggered when the View's ControlState is changed.
206 [EditorBrowsable(EditorBrowsableState.Never)]
207 public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
209 internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
213 /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
215 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
216 [EditorBrowsable(EditorBrowsableState.Never)]
217 public bool LayoutSet
226 /// Flag to allow Layouting to be disabled for Views.
227 /// Once a View has a Layout set then any children added to Views from then on will receive
228 /// automatic Layouts.
230 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
231 [EditorBrowsable(EditorBrowsableState.Never)]
232 public static bool LayoutingDisabled { get; set; } = true;
235 /// If set to true, the <see cref="GrabTouchAfterLeave"/> property value is set to true when all Views are created.
237 /// <param name="enable">Sets value of GrabTouchAfterLeave property</param>
238 [EditorBrowsable(EditorBrowsableState.Never)]
239 public static void SetDefaultGrabTouchAfterLeave(bool enable)
241 defaultGrabTouchAfterLeave = enable;
245 /// If set to true, the <see cref="AllowOnlyOwnTouch"/> property value is set to true when all Views are created.
247 /// <param name="enable">Sets value of AllowOnlyOwnTouch property</param>
248 [EditorBrowsable(EditorBrowsableState.Never)]
249 public static void SetDefaultAllowOnlyOwnTouch(bool enable)
251 defaultAllowOnlyOwnTouch = enable;
255 /// Deprecate. Do not use this.
256 /// The style instance applied to this view.
257 /// Note that do not modify the ViewStyle.
258 /// Modifying ViewStyle will affect other views with same ViewStyle.
260 [EditorBrowsable(EditorBrowsableState.Never)]
261 protected ViewStyle ViewStyle
265 if (themeData == null) themeData = new ThemeData();
267 if (themeData.viewStyle == null)
269 ApplyStyle(CreateViewStyle());
271 return themeData.viewStyle;
276 /// Get/Set the control state.
277 /// Note that the ControlState only available for the classes derived from Control.
278 /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
279 /// please set <see cref="EnableControlState"/> to true.
281 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
282 [EditorBrowsable(EditorBrowsableState.Never)]
283 public ControlState ControlState
287 return themeData == null ? ControlState.Normal : themeData.controlStates;
291 if (ControlState == value)
296 var prevState = ControlState;
298 if (themeData == null) themeData = new ThemeData();
299 themeData.controlStates = value;
301 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
303 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
305 if (themeData.ControlStatePropagation)
307 foreach (View child in Children)
309 ControlState allowed = child.PropagatableControlStates;
310 if (allowed.Contains(ControlState.All))
312 child.ControlState = value;
316 ControlState newControlState = child.ControlState;
318 if (allowed.Contains(ControlState.Normal))
320 if (value.Contains(ControlState.Normal))
322 newControlState += ControlState.Normal;
326 newControlState -= ControlState.Normal;
330 if (allowed.Contains(ControlState.Disabled))
332 if (value.Contains(ControlState.Disabled))
334 newControlState += ControlState.Disabled;
338 newControlState -= ControlState.Disabled;
342 if (allowed.Contains(ControlState.Selected))
344 if (value.Contains(ControlState.Selected))
346 newControlState += ControlState.Selected;
350 newControlState -= ControlState.Selected;
354 if (allowed.Contains(ControlState.Pressed))
356 if (value.Contains(ControlState.Pressed))
358 newControlState += ControlState.Pressed;
362 newControlState -= ControlState.Pressed;
366 if (allowed.Contains(ControlState.Focused))
368 if (value.Contains(ControlState.Focused))
370 newControlState += ControlState.Focused;
374 newControlState -= ControlState.Focused;
378 if (allowed.Contains(ControlState.Other))
380 if (value.Contains(ControlState.Other))
382 newControlState += ControlState.Other;
386 newControlState -= ControlState.Other;
390 if (child.ControlState != newControlState)
391 child.ControlState = newControlState;
396 OnControlStateChanged(changeInfo);
398 ControlStateChangedEvent?.Invoke(this, changeInfo);
403 /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
405 /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
406 [EditorBrowsable(EditorBrowsableState.Never)]
407 public bool ExcludeLayouting
411 return (bool)GetValue(ExcludeLayoutingProperty);
415 SetValue(ExcludeLayoutingProperty, value);
416 NotifyPropertyChanged();
420 private bool InternalExcludeLayouting
424 return excludeLayouting;
428 excludeLayouting = value;
429 if (Layout != null && Layout.SetPositionByLayout == value)
431 Layout.SetPositionByLayout = !value;
432 Layout.RequestLayout();
438 /// The StyleName, type string.
439 /// The value indicates DALi style name defined in json theme file.
441 /// <since_tizen> 3 </since_tizen>
442 public string StyleName
446 return (string)GetValue(StyleNameProperty);
450 SetValue(StyleNameProperty, value);
451 NotifyPropertyChanged();
456 /// The KeyInputFocus, type bool.
458 [EditorBrowsable(EditorBrowsableState.Never)]
459 public bool KeyInputFocus
463 return (bool)GetValue(KeyInputFocusProperty);
467 SetValue(KeyInputFocusProperty, value);
468 NotifyPropertyChanged();
473 /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
477 /// The property cascade chaining set is not recommended.
480 /// Animatable - This property can be animated using <c>Animation</c> class.
482 /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
487 /// This way is recommended for setting the property
489 /// var view = new View();
490 /// view.BackgroundColor = new Color(0.5f, 0.1f, 0, 1);
492 /// This way to set the property is prohibited
494 /// view.BackgroundColor.R = 0.5f; //This does not guarantee a proper operation
497 /// <since_tizen> 3 </since_tizen>
498 public Color BackgroundColor
502 return (Color)GetValue(BackgroundColorProperty);
506 SetValue(BackgroundColorProperty, value);
507 NotifyPropertyChanged();
512 /// The mutually exclusive with "backgroundColor" and "background" type Map.
514 /// <since_tizen> 3 </since_tizen>
515 public string BackgroundImage
519 return (string)GetValue(BackgroundImageProperty);
523 SetValue(BackgroundImageProperty, value);
524 NotifyPropertyChanged();
529 /// Get or set the border of background image.
531 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
532 [EditorBrowsable(EditorBrowsableState.Never)]
533 public Rectangle BackgroundImageBorder
537 return (Rectangle)GetValue(BackgroundImageBorderProperty);
541 SetValue(BackgroundImageBorderProperty, value);
542 NotifyPropertyChanged();
547 /// The background of view.
549 /// <since_tizen> 3 </since_tizen>
550 public Tizen.NUI.PropertyMap Background
554 return (PropertyMap)GetValue(BackgroundProperty);
558 SetValue(BackgroundProperty, value);
559 NotifyPropertyChanged();
564 /// Describes a shadow as an image for a View.
565 /// It is null by default.
568 /// Getter returns copied instance of current shadow.
571 /// The mutually exclusive with "BoxShadow".
575 /// Animatable - This property can be animated using <c>Animation</c> class.
576 /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
578 /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
580 /// Animatable sub-property : Offset.
583 [EditorBrowsable(EditorBrowsableState.Never)]
584 public ImageShadow ImageShadow
588 return (ImageShadow)GetValue(ImageShadowProperty);
592 SetValue(ImageShadowProperty, value);
593 NotifyPropertyChanged();
598 /// Describes a box shaped shadow drawing for a View.
599 /// It is null by default.
602 /// The mutually exclusive with "ImageShadow".
606 /// Animatable - This property can be animated using <c>Animation</c> class.
607 /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
609 /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
611 /// Animatable sub-property : Offset, Color, BlurRadius.
614 /// <since_tizen> 9 </since_tizen>
615 public Shadow BoxShadow
619 return (Shadow)GetValue(BoxShadowProperty);
623 SetValue(BoxShadowProperty, value);
624 NotifyPropertyChanged();
629 /// The radius for the rounded corners of the View.
630 /// This will rounds background and shadow edges.
631 /// 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).
632 /// Each radius will clamp internally to the half of smaller of the view's width or height.
633 /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
637 /// Animatable - This property can be animated using <c>Animation</c> class.
639 /// animation.AnimateTo(view, "CornerRadius", new Vector4(10, 10, 10, 10));
643 /// <since_tizen> 9 </since_tizen>
644 public Vector4 CornerRadius
648 return (Vector4)GetValue(CornerRadiusProperty);
652 SetValue(CornerRadiusProperty, value);
653 NotifyPropertyChanged();
658 /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
659 /// It is absolute by default.
660 /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
662 /// <since_tizen> 9 </since_tizen>
663 public VisualTransformPolicyType CornerRadiusPolicy
665 get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
666 set => SetValue(CornerRadiusPolicyProperty, value);
670 /// The width for the borderline of the View.
674 /// Animatable - This property can be animated using <c>Animation</c> class.
676 /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
679 /// Note that, an image background may not have borderline if it uses the Border property.
681 /// <since_tizen> 9 </since_tizen>
682 public float BorderlineWidth
686 return (float)GetValue(BorderlineWidthProperty);
690 SetValue(BorderlineWidthProperty, value);
691 NotifyPropertyChanged();
696 /// The color for the borderline of the View.
697 /// It is Color.Black by default.
701 /// Animatable - This property can be animated using <c>Animation</c> class.
703 /// animation.AnimateTo(view, "BorderlineColor", new Color(r, g, b, a));
707 /// <since_tizen> 9 </since_tizen>
708 public Color BorderlineColor
712 return (Color)GetValue(BorderlineColorProperty);
716 SetValue(BorderlineColorProperty, value);
717 NotifyPropertyChanged();
722 /// The color selector for the borderline of the View.
723 /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
724 /// So this API is internally used only.
726 internal Selector<Color> BorderlineColorSelector
730 return (Selector<Color>)GetValue(BorderlineColorSelectorProperty);
734 SetValue(BorderlineColorSelectorProperty, value);
735 NotifyPropertyChanged();
740 /// The Relative offset for the borderline of the View.
741 /// Recommended range : [-1.0f to 1.0f].
742 /// If -1.0f, draw borderline inside of the View.
743 /// If 1.0f, draw borderline outside of the View.
744 /// If 0.0f, draw borderline half inside and half outside.
745 /// It is 0.0f by default.
749 /// Animatable - This property can be animated using <c>Animation</c> class.
751 /// animation.AnimateTo(view, "BorderlineOffset", -1.0f);
755 /// <since_tizen> 9 </since_tizen>
756 public float BorderlineOffset
760 return (float)GetValue(BorderlineOffsetProperty);
764 SetValue(BorderlineOffsetProperty, value);
765 NotifyPropertyChanged();
770 /// The current state of the view.
772 /// <since_tizen> 3 </since_tizen>
777 return (States)GetValue(StateProperty);
781 SetValue(StateProperty, value);
782 NotifyPropertyChanged();
787 /// The current sub state of the view.
789 /// <since_tizen> 3 </since_tizen>
790 public States SubState
794 return (States)GetValue(SubStateProperty);
798 SetValue(SubStateProperty, value);
799 NotifyPropertyChanged();
804 /// Displays a tooltip
806 /// <since_tizen> 3 </since_tizen>
807 public Tizen.NUI.PropertyMap Tooltip
811 return (PropertyMap)GetValue(TooltipProperty);
815 SetValue(TooltipProperty, value);
816 NotifyPropertyChanged();
821 /// Displays a tooltip as a text.
823 /// <since_tizen> 3 </since_tizen>
824 public string TooltipText
828 return GetValue(TooltipTextProperty) as string;
832 SetValue(TooltipTextProperty, value);
836 private string InternalTooltipText
840 using (var propertyValue = GetProperty(Property.TOOLTIP))
842 if (propertyValue != null && propertyValue.Get(out string retrivedValue))
844 return retrivedValue;
846 NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
847 return "error to get TooltipText";
852 var temp = new Tizen.NUI.PropertyValue(value);
853 SetProperty(View.Property.TOOLTIP, temp);
855 NotifyPropertyChanged();
860 /// The Child property of FlexContainer.<br />
861 /// The proportion of the free space in the container, the flex item will receive.<br />
862 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
864 /// <since_tizen> 3 </since_tizen>
865 [Obsolete("Deprecated in API8, will be removed in API10.")]
870 return (float)GetValue(FlexProperty);
874 SetValue(FlexProperty, value);
875 NotifyPropertyChanged();
880 /// The Child property of FlexContainer.<br />
881 /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
883 /// <since_tizen> 3 </since_tizen>
884 [Obsolete("Deprecated in API8, will be removed in API10.")]
889 return (int)GetValue(AlignSelfProperty);
893 SetValue(AlignSelfProperty, value);
894 NotifyPropertyChanged();
899 /// The Child property of FlexContainer.<br />
900 /// The space around the flex item.<br />
903 /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
905 /// <since_tizen> 3 </since_tizen>
906 [Obsolete("Deprecated in API8, will be removed in API10.")]
907 public Vector4 FlexMargin
911 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
912 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
916 SetValue(FlexMarginProperty, value);
917 NotifyPropertyChanged();
922 /// The top-left cell this child occupies, if not set, the first available cell is used.
925 /// The property cascade chaining set is not recommended.
926 /// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
929 /// This way is recommended for setting the property
931 /// var view = new View();
932 /// view.CellIndex = new Vector2(1, 3);
934 /// This way to set the property is prohibited
936 /// view.CellIndex.X = 1; //This does not guarantee a proper operation
939 /// <since_tizen> 3 </since_tizen>
940 public Vector2 CellIndex
944 return (Vector2)GetValue(CellIndexProperty);
948 SetValue(CellIndexProperty, value);
949 NotifyPropertyChanged();
954 /// The number of rows this child occupies, if not set, the default value is 1.
957 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
959 /// <since_tizen> 3 </since_tizen>
964 return (float)GetValue(RowSpanProperty);
968 SetValue(RowSpanProperty, value);
969 NotifyPropertyChanged();
974 /// The number of columns this child occupies, if not set, the default value is 1.
977 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
979 /// <since_tizen> 3 </since_tizen>
980 public float ColumnSpan
984 return (float)GetValue(ColumnSpanProperty);
988 SetValue(ColumnSpanProperty, value);
989 NotifyPropertyChanged();
994 /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
997 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
999 /// <since_tizen> 3 </since_tizen>
1000 public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
1004 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
1008 SetValue(CellHorizontalAlignmentProperty, value);
1009 NotifyPropertyChanged();
1014 /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
1017 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1019 /// <since_tizen> 3 </since_tizen>
1020 public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
1024 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
1028 SetValue(CellVerticalAlignmentProperty, value);
1029 NotifyPropertyChanged();
1034 /// The left focusable view.<br />
1035 /// This will return null if not set.<br />
1036 /// This will also return null if the specified left focusable view is not on a window.<br />
1038 /// <since_tizen> 3 </since_tizen>
1039 public View LeftFocusableView
1041 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1044 return (View)GetValue(LeftFocusableViewProperty);
1048 SetValue(LeftFocusableViewProperty, value);
1049 NotifyPropertyChanged();
1054 /// The right focusable view.<br />
1055 /// This will return null if not set.<br />
1056 /// This will also return null if the specified right focusable view is not on a window.<br />
1058 /// <since_tizen> 3 </since_tizen>
1059 public View RightFocusableView
1061 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1064 return (View)GetValue(RightFocusableViewProperty);
1068 SetValue(RightFocusableViewProperty, value);
1069 NotifyPropertyChanged();
1074 /// The up focusable view.<br />
1075 /// This will return null if not set.<br />
1076 /// This will also return null if the specified up focusable view is not on a window.<br />
1078 /// <since_tizen> 3 </since_tizen>
1079 public View UpFocusableView
1081 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1084 return (View)GetValue(UpFocusableViewProperty);
1088 SetValue(UpFocusableViewProperty, value);
1089 NotifyPropertyChanged();
1094 /// The down focusable view.<br />
1095 /// This will return null if not set.<br />
1096 /// This will also return null if the specified down focusable view is not on a window.<br />
1098 /// <since_tizen> 3 </since_tizen>
1099 public View DownFocusableView
1101 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1104 return (View)GetValue(DownFocusableViewProperty);
1108 SetValue(DownFocusableViewProperty, value);
1109 NotifyPropertyChanged();
1114 /// The clockwise focusable view by rotary wheel.<br />
1115 /// This will return null if not set.<br />
1116 /// This will also return null if the specified clockwise focusable view is not on a window.<br />
1118 [EditorBrowsable(EditorBrowsableState.Never)]
1119 public View ClockwiseFocusableView
1121 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1124 return (View)GetValue(ClockwiseFocusableViewProperty);
1128 SetValue(ClockwiseFocusableViewProperty, value);
1129 NotifyPropertyChanged();
1134 /// The counter clockwise focusable view by rotary wheel.<br />
1135 /// This will return null if not set.<br />
1136 /// This will also return null if the specified counter clockwise focusable view is not on a window.<br />
1138 [EditorBrowsable(EditorBrowsableState.Never)]
1139 public View CounterClockwiseFocusableView
1141 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1144 return (View)GetValue(CounterClockwiseFocusableViewProperty);
1148 SetValue(CounterClockwiseFocusableViewProperty, value);
1149 NotifyPropertyChanged();
1154 /// Whether the view should be focusable by keyboard navigation.
1156 /// <since_tizen> 3 </since_tizen>
1157 public bool Focusable
1161 SetValue(FocusableProperty, value);
1162 NotifyPropertyChanged();
1166 return (bool)GetValue(FocusableProperty);
1171 /// 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.
1172 /// Note : Default value is true.
1174 [EditorBrowsable(EditorBrowsableState.Never)]
1175 public bool FocusableChildren
1179 SetValue(FocusableChildrenProperty, value);
1180 NotifyPropertyChanged();
1184 return (bool)GetValue(FocusableChildrenProperty);
1189 /// Whether this view can focus by touch.
1190 /// If Focusable is false, FocusableInTouch is disabled.
1191 /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
1193 [EditorBrowsable(EditorBrowsableState.Never)]
1194 public bool FocusableInTouch
1198 SetValue(FocusableInTouchProperty, value);
1199 NotifyPropertyChanged();
1203 return (bool)GetValue(FocusableInTouchProperty);
1208 /// Retrieves the position of the view.
1209 /// The coordinates are relative to the view's parent.
1212 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1213 /// 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).
1214 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1215 /// and users can get the current actual values through them.
1217 /// <since_tizen> 3 </since_tizen>
1218 public Position CurrentPosition
1222 return GetCurrentPosition();
1227 /// Sets the size of a view for the width and the height.<br />
1228 /// Geometry can be scaled to fit within this area.<br />
1229 /// This does not interfere with the view's scale factor.<br />
1230 /// The views default depth is the minimum of width and height.<br />
1233 /// The property cascade chaining set is not recommended.
1236 /// This way is recommended for setting the property
1238 /// var view = new View();
1239 /// view.Size2D = new Size2D(100, 200);
1241 /// This way to set the property is prohibited
1243 /// view.Size2D.Width = 100; //This does not guarantee a proper operation
1246 /// <since_tizen> 3 </since_tizen>
1247 public Size2D Size2D
1251 var temp = (Size2D)GetValue(Size2DProperty);
1253 if (this.Layout == null)
1255 if (temp.Width < 0) { temp.Width = 0; }
1256 if (temp.Height < 0) { temp.Height = 0; }
1263 SetValue(Size2DProperty, value);
1265 NotifyPropertyChanged();
1270 /// Retrieves the size of the view.
1271 /// The coordinates are relative to the view's parent.
1274 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1275 /// 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).
1276 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1277 /// and users can get the current actual values through them.
1279 /// <since_tizen> 3 </since_tizen>
1280 public Size2D CurrentSize
1284 return GetCurrentSize();
1289 /// Retrieves and sets the view's opacity.<br />
1293 /// Animatable - This property can be animated using <c>Animation</c> class.
1295 /// animation.AnimateTo(view, "Opacity", 0.5f);
1299 /// <since_tizen> 3 </since_tizen>
1300 public float Opacity
1304 return (float)GetValue(OpacityProperty);
1308 SetValue(OpacityProperty, value);
1309 NotifyPropertyChanged();
1314 /// Sets the position of the view for X and Y.<br />
1315 /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1316 /// If the position inheritance is disabled, sets the world position.<br />
1319 /// The property cascade chaining set is not recommended.
1322 /// This way is recommended for setting the property
1324 /// var view = new View();
1325 /// view.Position2D = new Position2D(100, 200);
1327 /// This way to set the property is prohibited
1329 /// view.Position2D.X = 100; //This does not guarantee a proper operation
1332 /// <since_tizen> 3 </since_tizen>
1333 public Position2D Position2D
1337 return (Position2D)GetValue(Position2DProperty);
1341 SetValue(Position2DProperty, value);
1342 NotifyPropertyChanged();
1347 /// Retrieves the screen position of the view.<br />
1349 /// <since_tizen> 3 </since_tizen>
1350 public Vector2 ScreenPosition
1354 return GetCurrentScreenPosition();
1359 /// Retrieves the screen position and size of the view.<br />
1362 /// The float type Rectangle class is not ready yet.
1363 /// Therefore, it transmits data in Vector4 class.
1364 /// This type should later be changed to the appropriate data type.
1366 [EditorBrowsable(EditorBrowsableState.Never)]
1367 public Vector4 ScreenPositionSize
1371 return GetCurrentScreenPositionSize();
1376 /// Determines whether the pivot point should be used to determine the position of the view.
1377 /// This is false by default.
1379 /// <remarks>If false, then the top-left of the view is used for the position.
1380 /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1382 /// <since_tizen> 3 </since_tizen>
1383 public bool PositionUsesPivotPoint
1387 return (bool)GetValue(PositionUsesPivotPointProperty);
1391 SetValue(PositionUsesPivotPointProperty, value);
1392 NotifyPropertyChanged();
1397 /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead.
1399 /// <since_tizen> 3 </since_tizen>
1400 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PositionUsesPivotPoint instead. " +
1402 "View view = new View(); " +
1403 "view.PivotPoint = PivotPoint.Center; " +
1404 "view.PositionUsesPivotPoint = true;" +
1405 " This has been deprecated in API5 and will be removed in API8")]
1406 [EditorBrowsable(EditorBrowsableState.Never)]
1407 public bool PositionUsesAnchorPoint
1411 return (bool)GetValue(PositionUsesAnchorPointProperty);
1415 SetValue(PositionUsesAnchorPointProperty, value);
1419 private bool InternalPositionUsesAnchorPoint
1423 #if NUI_VISUAL_PROPERTY_CHANGE_1
1424 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint);
1427 var pValue = GetProperty(View.Property.PositionUsesAnchorPoint);
1428 pValue.Get(out temp);
1435 #if NUI_VISUAL_PROPERTY_CHANGE_1
1436 Object.InternalSetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint, value);
1438 var temp = new Tizen.NUI.PropertyValue(value);
1439 SetProperty(View.Property.PositionUsesAnchorPoint, temp);
1442 NotifyPropertyChanged();
1447 /// Queries whether the view is connected to the stage.<br />
1448 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1450 /// <since_tizen> 3 </since_tizen>
1451 public bool IsOnWindow
1460 /// Gets the depth in the hierarchy for the view.
1462 /// <since_tizen> 3 </since_tizen>
1463 public int HierarchyDepth
1467 return GetHierarchyDepth();
1472 /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1475 /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1476 /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1477 /// The values set by this property will likely change.
1479 /// <since_tizen> 3 </since_tizen>
1480 public int SiblingOrder
1484 return (int)GetValue(SiblingOrderProperty);
1488 SetValue(SiblingOrderProperty, value);
1490 Layout?.ChangeLayoutSiblingOrder(value);
1492 NotifyPropertyChanged();
1497 /// Returns the natural size of the view.
1500 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1502 /// <since_tizen> 5 </since_tizen>
1503 public Vector3 NaturalSize
1507 Vector3 ret = GetNaturalSize();
1508 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1514 /// Returns the natural size (Size2D) of the view.
1517 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1519 /// <since_tizen> 4 </since_tizen>
1520 public Size2D NaturalSize2D
1524 Vector3 temp = GetNaturalSize();
1525 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1527 Size2D sz = new Size2D((int)temp.Width, (int)temp.Height);
1534 /// Gets or sets the origin of a view within its parent's area.<br />
1535 /// 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 />
1536 /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1537 /// A view's position is the distance between this origin and the view's anchor-point.<br />
1539 /// <pre>The view has been initialized.</pre>
1540 /// <since_tizen> 3 </since_tizen>
1541 public Position ParentOrigin
1545 Position tmp = (Position)GetValue(ParentOriginProperty);
1546 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1550 SetValue(ParentOriginProperty, value);
1551 NotifyPropertyChanged();
1556 /// Gets or sets the anchor-point of a view.<br />
1557 /// 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 />
1558 /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1559 /// A view position is the distance between its parent-origin and this anchor-point.<br />
1560 /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1561 /// <pre>The view has been initialized.</pre>
1564 /// The property cascade chaining set is not recommended.
1567 /// This way is recommended for setting the property
1569 /// var view = new View();
1570 /// view.PivotPoint = PivotPoint.Center;
1572 /// This way to set the property is prohibited
1574 /// view.PivotPoint.X = 0.5f; //This does not guarantee a proper operation
1577 /// <since_tizen> 3 </since_tizen>
1578 public Position PivotPoint
1582 return (Position)GetValue(PivotPointProperty);
1586 SetValue(PivotPointProperty, value);
1587 NotifyPropertyChanged();
1592 /// Gets or sets the size width of the view.
1596 /// Animatable - This property can be animated using <c>Animation</c> class.
1598 /// animation.AnimateTo(view, "SizeWidth", 500.0f);
1602 /// <since_tizen> 3 </since_tizen>
1603 public float SizeWidth
1607 return (float)GetValue(SizeWidthProperty);
1611 SetValue(SizeWidthProperty, value);
1612 NotifyPropertyChanged();
1617 /// Gets or sets the size height of the view.
1621 /// Animatable - This property can be animated using <c>Animation</c> class.
1624 /// animation.AnimateTo(view, "SizeHeight", 500.0f);
1627 /// <since_tizen> 3 </since_tizen>
1628 public float SizeHeight
1632 return (float)GetValue(SizeHeightProperty);
1636 SetValue(SizeHeightProperty, value);
1637 NotifyPropertyChanged();
1642 /// Gets or sets the position of the view.<br />
1643 /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1644 /// If the position inheritance is disabled, sets the world position.<br />
1648 /// Animatable - This property can be animated using <c>Animation</c> class.
1650 /// animation.AnimateTo(view, "Position", new Position(50, 0));
1653 /// The property cascade chaining set is not recommended.
1656 /// This way is recommended for setting the property
1658 /// var view = new View();
1659 /// view.Position = new Position(100, 200.5f, 0);
1661 /// This way to set the property is prohibited
1663 /// view.Position.Y = 200.5f; //This does not guarantee a proper operation
1666 /// <since_tizen> 3 </since_tizen>
1667 public Position Position
1671 return (Position)GetValue(PositionProperty);
1675 SetValue(PositionProperty, value);
1676 NotifyPropertyChanged();
1681 /// Gets or sets the position X of the view.
1685 /// Animatable - This property can be animated using <c>Animation</c> class.
1687 /// animation.AnimateTo(view, "PositionX", 50.0f);
1691 /// <since_tizen> 3 </since_tizen>
1692 public float PositionX
1696 return (float)GetValue(PositionXProperty);
1700 SetValue(PositionXProperty, value);
1701 NotifyPropertyChanged();
1706 /// Gets or sets the position Y of the view.
1710 /// Animatable - This property can be animated using <c>Animation</c> class.
1712 /// animation.AnimateTo(view, "PositionY", 50.0f);
1716 /// <since_tizen> 3 </since_tizen>
1717 public float PositionY
1721 return (float)GetValue(PositionYProperty);
1725 SetValue(PositionYProperty, value);
1726 NotifyPropertyChanged();
1731 /// Gets or sets the position Z of the view.
1735 /// Animatable - This property can be animated using <c>Animation</c> class.
1737 /// animation.AnimateTo(view, "PositionZ", 50.0f);
1741 /// <since_tizen> 3 </since_tizen>
1742 public float PositionZ
1746 return (float)GetValue(PositionZProperty);
1750 SetValue(PositionZProperty, value);
1751 NotifyPropertyChanged();
1756 /// Gets or sets the world position of the view.
1758 /// <since_tizen> 3 </since_tizen>
1759 public Vector3 WorldPosition
1763 #if NUI_VISUAL_PROPERTY_CHANGE_1
1764 return GetCurrentWorldPosition();
1766 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1767 var pValue = GetProperty(View.Property.WorldPosition);
1776 /// Gets or sets the orientation of the view.<br />
1777 /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1781 /// This is an asynchronous method.
1784 /// Animatable - This property can be animated using <c>Animation</c> class.
1786 /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
1790 /// <since_tizen> 3 </since_tizen>
1791 public Rotation Orientation
1795 return (Rotation)GetValue(OrientationProperty);
1799 SetValue(OrientationProperty, value);
1800 NotifyPropertyChanged();
1805 /// Gets or sets the world orientation of the view.<br />
1807 /// <since_tizen> 3 </since_tizen>
1808 public Rotation WorldOrientation
1812 Rotation temp = new Rotation();
1813 var pValue = GetProperty(View.Property.WorldOrientation);
1821 /// Gets or sets the scale factor applied to the view.<br />
1825 /// Animatable - This property can be animated using <c>Animation</c> class.
1827 /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
1830 /// The property cascade chaining set is not recommended.
1833 /// This way is recommended for setting the property
1835 /// var view = new View();
1836 /// view.Scale = new Vector3(1.5f, 2.0f, 1.0f);
1838 /// This way to set the property is prohibited
1840 /// view.Scale.Width = 1.5f; //This does not guarantee a proper operation
1843 /// <since_tizen> 3 </since_tizen>
1844 public Vector3 Scale
1848 return (Vector3)GetValue(ScaleProperty);
1852 SetValue(ScaleProperty, value);
1853 NotifyPropertyChanged();
1858 /// Gets or sets the scale X factor applied to the view.
1862 /// Animatable - This property can be animated using <c>Animation</c> class.
1864 /// animation.AnimateTo(view, "ScaleX", 1.5f);
1868 /// <since_tizen> 3 </since_tizen>
1873 return (float)GetValue(ScaleXProperty);
1877 SetValue(ScaleXProperty, value);
1878 NotifyPropertyChanged();
1883 /// Gets or sets the scale Y factor applied to the view.
1887 /// Animatable - This property can be animated using <c>Animation</c> class.
1889 /// animation.AnimateTo(view, "ScaleY", 1.5f);
1893 /// <since_tizen> 3 </since_tizen>
1898 return (float)GetValue(ScaleYProperty);
1902 SetValue(ScaleYProperty, value);
1903 NotifyPropertyChanged();
1908 /// Gets or sets the scale Z factor applied to the view.
1912 /// Animatable - This property can be animated using <c>Animation</c> class.
1914 /// animation.AnimateTo(view, "ScaleZ", 1.5f);
1918 /// <since_tizen> 3 </since_tizen>
1923 return (float)GetValue(ScaleZProperty);
1927 SetValue(ScaleZProperty, value);
1928 NotifyPropertyChanged();
1933 /// Gets the world scale of the view.
1935 /// <since_tizen> 3 </since_tizen>
1936 public Vector3 WorldScale
1940 #if NUI_VISUAL_PROPERTY_CHANGE_1
1941 return GetCurrentWorldScale();
1943 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1944 var pValue = GetProperty(View.Property.WorldScale);
1953 /// Retrieves the visibility flag of the view.
1957 /// If the view is not visible, then the view and its children will not be rendered.
1958 /// 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.
1961 /// Animatable - This property can be animated using <c>Animation</c> class.
1963 /// animation.AnimateTo(view, "Visibility", false);
1967 /// <since_tizen> 3 </since_tizen>
1968 public bool Visibility
1972 #if NUI_VISUAL_PROPERTY_CHANGE_1
1973 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.VISIBLE);
1976 var pValue = GetProperty(View.Property.VISIBLE);
1977 pValue.Get(out temp);
1985 /// Gets the view's world color.
1987 /// <since_tizen> 3 </since_tizen>
1988 public Vector4 WorldColor
1992 #if NUI_VISUAL_PROPERTY_CHANGE_1
1993 return GetCurrentWorldColor();
1995 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
1996 var pValue = GetProperty(View.Property.WorldColor);
2005 /// Gets or sets the view's name.
2007 /// <since_tizen> 3 </since_tizen>
2012 return (string)GetValue(NameProperty);
2016 SetValue(NameProperty, value);
2017 NotifyPropertyChanged();
2022 /// Get the number of children held by the view.
2024 /// <since_tizen> 3 </since_tizen>
2025 public new uint ChildCount
2029 return Convert.ToUInt32(Children.Count);
2034 /// Gets the view's ID.
2037 /// <since_tizen> 3 </since_tizen>
2047 /// Gets or sets the status of whether the view should emit touch or hover signals.
2048 /// If a View is made insensitive, then the View and its children are not hittable.
2050 /// <since_tizen> 3 </since_tizen>
2051 public bool Sensitive
2055 return (bool)GetValue(SensitiveProperty);
2059 SetValue(SensitiveProperty, value);
2060 NotifyPropertyChanged();
2065 /// Gets or sets the status of whether the view should be enabled user interactions.
2066 /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled.
2068 /// <since_tizen> tizen_next </since_tizen>
2069 [EditorBrowsable(EditorBrowsableState.Never)]
2070 public bool IsEnabled
2074 return (bool)GetValue(IsEnabledProperty);
2078 SetValue(IsEnabledProperty, value);
2079 NotifyPropertyChanged();
2084 /// 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.
2086 /// <since_tizen> 3 </since_tizen>
2087 public bool LeaveRequired
2091 return (bool)GetValue(LeaveRequiredProperty);
2095 SetValue(LeaveRequiredProperty, value);
2096 NotifyPropertyChanged();
2101 /// Gets or sets the status of whether a child view inherits it's parent's orientation.
2103 /// <since_tizen> 3 </since_tizen>
2104 public bool InheritOrientation
2108 return (bool)GetValue(InheritOrientationProperty);
2112 SetValue(InheritOrientationProperty, value);
2113 NotifyPropertyChanged();
2118 /// Gets or sets the status of whether a child view inherits it's parent's scale.
2120 /// <since_tizen> 3 </since_tizen>
2121 public bool InheritScale
2125 return (bool)GetValue(InheritScaleProperty);
2129 SetValue(InheritScaleProperty, value);
2130 NotifyPropertyChanged();
2135 /// Gets or sets the status of how the view and its children should be drawn.<br />
2136 /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
2137 /// 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 />
2138 /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
2139 /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
2140 /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
2142 /// <since_tizen> 3 </since_tizen>
2143 public DrawModeType DrawMode
2147 return (DrawModeType)GetValue(DrawModeProperty);
2151 SetValue(DrawModeProperty, value);
2152 NotifyPropertyChanged();
2157 /// Gets or sets the relative to parent size factor of the view.<br />
2158 /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
2159 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
2162 /// The property cascade chaining set is not recommended.
2165 /// This way is recommended for setting the property
2167 /// var text = new TextField();
2168 /// text.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
2170 /// This way to set the property is prohibited
2172 /// text.SizeModeFactor.Width = 1.0f; //This does not guarantee a proper operation
2175 /// <since_tizen> 3 </since_tizen>
2176 public Vector3 SizeModeFactor
2180 return (Vector3)GetValue(SizeModeFactorProperty);
2184 SetValue(SizeModeFactorProperty, value);
2185 NotifyPropertyChanged();
2190 /// Gets or sets the width resize policy to be used.
2192 /// <since_tizen> 3 </since_tizen>
2193 public ResizePolicyType WidthResizePolicy
2197 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
2201 SetValue(WidthResizePolicyProperty, value);
2202 NotifyPropertyChanged();
2207 /// Gets or sets the height resize policy to be used.
2209 /// <since_tizen> 3 </since_tizen>
2210 public ResizePolicyType HeightResizePolicy
2214 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
2218 SetValue(HeightResizePolicyProperty, value);
2219 NotifyPropertyChanged();
2224 /// Gets or sets the policy to use when setting size with size negotiation.<br />
2225 /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
2227 /// <since_tizen> 3 </since_tizen>
2228 public SizeScalePolicyType SizeScalePolicy
2232 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
2236 SetValue(SizeScalePolicyProperty, value);
2237 NotifyPropertyChanged();
2242 /// Gets or sets the status of whether the width size is dependent on the height size.
2244 /// <since_tizen> 3 </since_tizen>
2245 public bool WidthForHeight
2249 return (bool)GetValue(WidthForHeightProperty);
2253 SetValue(WidthForHeightProperty, value);
2254 NotifyPropertyChanged();
2259 /// Gets or sets the status of whether the height size is dependent on the width size.
2261 /// <since_tizen> 3 </since_tizen>
2262 public bool HeightForWidth
2266 return (bool)GetValue(HeightForWidthProperty);
2270 SetValue(HeightForWidthProperty, value);
2271 NotifyPropertyChanged();
2276 /// Gets or sets the padding for use in layout.
2279 /// The property cascade chaining set is not recommended.
2282 /// This way is recommended for setting the property
2284 /// var view = new View();
2285 /// view.Padding = new Extents(5, 5, 5, 5);
2287 /// This way to set the property is prohibited
2289 /// view.Padding.Start = 5; //This does not guarantee a proper operation
2292 /// <since_tizen> 5 </since_tizen>
2293 public Extents Padding
2297 return (Extents)GetValue(PaddingProperty);
2301 SetValue(PaddingProperty, value);
2302 NotifyPropertyChanged();
2307 /// Gets or sets the minimum size the view can be assigned in size negotiation.
2309 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
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.MinimumSize = new Size2D(100, 200);
2319 /// This way to set the property is prohibited
2321 /// view.MinimumSize.Width = 100; //This does not guarantee a proper operation
2324 /// <since_tizen> 3 </since_tizen>
2325 public Size2D MinimumSize
2329 return (Size2D)GetValue(MinimumSizeProperty);
2335 throw new ArgumentNullException(nameof(value));
2339 // Note: it only works if minimum size is >= than natural size.
2340 // To force the size it should be done through the width&height spec or Size2D.
2341 layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
2342 layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
2343 layout.RequestLayout();
2345 SetValue(MinimumSizeProperty, value);
2346 NotifyPropertyChanged();
2351 /// Gets or sets the maximum size the view can be assigned in size negotiation.
2354 /// This way is recommended for setting the property
2356 /// var view = new View();
2357 /// view.MaximumSize = new Size2D(100, 200);
2359 /// This way to set the property is prohibited
2361 /// view.MaximumSize.Height = 200; //This does not guarantee a proper operation
2364 /// <since_tizen> 3 </since_tizen>
2365 public Size2D MaximumSize
2369 return (Size2D)GetValue(MaximumSizeProperty);
2373 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
2374 // MATCH_PARENT spec + parent container size can be used to limit
2377 layout.RequestLayout();
2379 SetValue(MaximumSizeProperty, value);
2380 NotifyPropertyChanged();
2385 /// Gets or sets whether a child view inherits it's parent's position.<br />
2386 /// Default is to inherit.<br />
2387 /// 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 />
2389 /// <since_tizen> 3 </since_tizen>
2390 public bool InheritPosition
2394 return (bool)GetValue(InheritPositionProperty);
2398 SetValue(InheritPositionProperty, value);
2399 NotifyPropertyChanged();
2404 /// Gets or sets the clipping behavior (mode) of it's children.
2406 /// <since_tizen> 3 </since_tizen>
2407 public ClippingModeType ClippingMode
2411 return (ClippingModeType)GetValue(ClippingModeProperty);
2415 SetValue(ClippingModeProperty, value);
2416 NotifyPropertyChanged();
2421 /// Gets the number of renderers held by the view.
2423 /// <since_tizen> 3 </since_tizen>
2424 public uint RendererCount
2428 return GetRendererCount();
2433 /// This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead.
2436 /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2438 /// <since_tizen> 3 </since_tizen>
2439 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead. " +
2441 "View view = new View(); " +
2442 "view.PivotPoint = PivotPoint.Center; " +
2443 "view.PositionUsesPivotPoint = true;")]
2444 [EditorBrowsable(EditorBrowsableState.Never)]
2445 public Position AnchorPoint
2449 return GetValue(AnchorPointProperty) as Position;
2453 SetValue(AnchorPointProperty, value);
2457 private Position InternalAnchorPoint
2461 #if NUI_VISUAL_PROPERTY_CHANGE_1
2462 return GetCurrentAnchorPoint();
2464 Position temp = new Position(0.0f, 0.0f, 0.0f);
2465 var pValue = GetProperty(View.Property.AnchorPoint);
2468 Position ret = new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
2475 #if NUI_VISUAL_PROPERTY_CHANGE_1
2476 SetAnchorPoint(value);
2478 var temp = new Tizen.NUI.PropertyValue(value);
2479 SetProperty(View.Property.AnchorPoint, temp);
2482 NotifyPropertyChanged();
2487 /// Sets the size of a view for the width, the height and the depth.<br />
2488 /// Geometry can be scaled to fit within this area.<br />
2489 /// This does not interfere with the view's scale factor.<br />
2490 /// The views default depth is the minimum of width and height.<br />
2494 /// Animatable - This property can be animated using <c>Animation</c> class.
2496 /// animation.AnimateTo(view, "Size", new Size(100, 100));
2499 /// The property cascade chaining set is not recommended.
2502 /// This way is recommended for setting the property
2504 /// var view = new View();
2505 /// view.Size = new Size(100.5f, 200, 0);
2507 /// This way to set the property is prohibited
2509 /// view.Size.Width = 100.5f; //This does not guarantee a proper operation
2512 /// <since_tizen> 5 </since_tizen>
2517 return (Size)GetValue(SizeProperty);
2521 SetValue(SizeProperty, value);
2522 NotifyPropertyChanged();
2527 /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead.
2529 /// <since_tizen> 3 </since_tizen>
2530 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. " +
2532 "Container parent = view.GetParent(); " +
2533 "View view = parent as View;")]
2534 [EditorBrowsable(EditorBrowsableState.Never)]
2535 public new View Parent
2540 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2541 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2542 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2544 if (basehandle is Layer layer)
2546 ret = new View(Layer.getCPtr(layer).Handle, false);
2547 NUILog.Error("This Parent property is deprecated, should do not be used");
2551 ret = basehandle as View;
2554 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2555 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2557 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2563 /// Gets/Sets whether inherit parent's the layout Direction.
2565 /// <since_tizen> 4 </since_tizen>
2566 public bool InheritLayoutDirection
2570 return (bool)GetValue(InheritLayoutDirectionProperty);
2574 SetValue(InheritLayoutDirectionProperty, value);
2575 NotifyPropertyChanged();
2580 /// Gets/Sets the layout Direction.
2582 /// <since_tizen> 4 </since_tizen>
2583 public ViewLayoutDirectionType LayoutDirection
2587 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2591 SetValue(LayoutDirectionProperty, value);
2592 NotifyPropertyChanged();
2593 layout?.RequestLayout();
2598 /// Gets or sets the Margin for use in layout.
2601 /// Margin property is supported by Layout algorithms and containers.
2602 /// Please Set Layout if you want to use Margin property.
2603 /// The property cascade chaining set is not recommended.
2606 /// This way is recommended for setting the property
2608 /// var view = new View();
2609 /// view.Margin = new Extents(10, 5, 15, 20);
2611 /// This way to set the property is prohibited
2613 /// view.Margin.Top = 15; //This does not guarantee a proper operation
2616 /// <since_tizen> 4 </since_tizen>
2617 public Extents Margin
2621 return (Extents)GetValue(MarginProperty);
2625 SetValue(MarginProperty, value);
2626 NotifyPropertyChanged();
2631 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2635 /// // matchParentView matches its size to its parent size.
2636 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2637 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2639 /// // wrapContentView wraps its children with their desired size.
2640 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2641 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2643 /// // exactSizeView shows itself with an exact size.
2644 /// exactSizeView.WidthSpecification = 100;
2645 /// exactSizeView.HeightSpecification = 100;
2648 /// <since_tizen> 6 </since_tizen>
2649 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2650 public int WidthSpecification
2654 return (int)GetValue(WidthSpecificationProperty);
2658 SetValue(WidthSpecificationProperty, value);
2659 NotifyPropertyChanged();
2663 private int InternalWidthSpecification
2671 if (value == widthPolicy)
2674 widthPolicy = value;
2675 if (widthPolicy >= 0)
2677 if (heightPolicy >= 0) // Policy an exact value
2679 // Create Size2D only both _widthPolicy and _heightPolicy are set.
2680 Size2D = new Size2D(widthPolicy, heightPolicy);
2683 layout?.RequestLayout();
2688 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2692 /// // matchParentView matches its size to its parent size.
2693 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2694 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2696 /// // wrapContentView wraps its children with their desired size.
2697 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2698 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2700 /// // exactSizeView shows itself with an exact size.
2701 /// exactSizeView.WidthSpecification = 100;
2702 /// exactSizeView.HeightSpecification = 100;
2705 /// <since_tizen> 6 </since_tizen>
2706 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2707 public int HeightSpecification
2711 return (int)GetValue(HeightSpecificationProperty);
2715 SetValue(HeightSpecificationProperty, value);
2716 NotifyPropertyChanged();
2720 private int InternalHeightSpecification
2724 return heightPolicy;
2728 if (value == heightPolicy)
2731 heightPolicy = value;
2732 if (heightPolicy >= 0)
2734 if (widthPolicy >= 0) // Policy an exact value
2736 // Create Size2D only both _widthPolicy and _heightPolicy are set.
2737 Size2D = new Size2D(widthPolicy, heightPolicy);
2740 layout?.RequestLayout();
2745 /// Gets the List of transitions for this View.
2747 /// <since_tizen> 6 </since_tizen>
2748 public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2752 if (layoutTransitions == null)
2754 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2756 return layoutTransitions;
2761 /// Sets a layout transitions for this View.
2763 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2765 /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2767 /// <since_tizen> 6 </since_tizen>
2768 public LayoutTransition LayoutTransition
2772 return GetValue(LayoutTransitionProperty) as LayoutTransition;
2776 SetValue(LayoutTransitionProperty, value);
2777 NotifyPropertyChanged();
2781 private LayoutTransition InternalLayoutTransition
2785 return layoutTransition;
2791 throw new global::System.ArgumentNullException(nameof(value));
2793 if (layoutTransitions == null)
2795 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2798 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
2800 AttachTransitionsToChildren(value);
2802 layoutTransition = value;
2807 /// This has been deprecated in API5 and will be removed in API8. Use Padding instead.
2810 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2812 /// <since_tizen> 4 </since_tizen>
2813 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use Padding instead.")]
2814 [EditorBrowsable(EditorBrowsableState.Never)]
2815 public Extents PaddingEX
2819 return GetValue(PaddingEXProperty) as Extents;
2823 SetValue(PaddingEXProperty, value);
2827 private Extents InternalPaddingEX
2831 Extents temp = new Extents(0, 0, 0, 0);
2832 var pValue = GetProperty(View.Property.PADDING);
2835 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2841 var temp = new Tizen.NUI.PropertyValue(value);
2842 SetProperty(View.Property.PADDING, temp);
2844 NotifyPropertyChanged();
2845 layout?.RequestLayout();
2850 /// The Color of View. This is an RGBA value.
2851 /// Each RGBA components match as <see cref="ColorRed"/>, <see cref="ColorGreen"/>, <see cref="ColorBlue"/>, and <see cref="Opacity"/>.
2852 /// This property will multiply the final color of this view. (BackgroundColor, BorderlineColor, BackgroundImage, etc).
2853 /// For example, if view.BackgroundColor = Color.Yellow and view.Color = Color.Purple, this view will shown as Red.
2854 /// Inherient of color value depend on <see cref="ColorMode"/>.
2858 /// Animatable - This property can be animated using <c>Animation</c> class.
2860 /// The property cascade chaining set is not recommended.
2863 /// This way is recommended for setting the property
2865 /// var view = new View();
2866 /// view.Color = new Color(0.5f, 0.2f, 0.1f, 0.5f);
2868 /// This way to set the property is prohibited
2870 /// view.Color.A = 0.5f; //This does not guarantee a proper operation
2873 [EditorBrowsable(EditorBrowsableState.Never)]
2878 return (Color)GetValue(ColorProperty);
2882 SetValue(ColorProperty, value);
2883 NotifyPropertyChanged();
2888 /// The Red component of View.Color.
2892 /// Animatable - This property can be animated using <c>Animation</c> class.
2895 [EditorBrowsable(EditorBrowsableState.Never)]
2896 public float ColorRed
2900 return (float)GetValue(ColorRedProperty);
2904 SetValue(ColorRedProperty, value);
2905 NotifyPropertyChanged();
2910 /// The Green component of View.Color.
2914 /// Animatable - This property can be animated using <c>Animation</c> class.
2917 [EditorBrowsable(EditorBrowsableState.Never)]
2918 public float ColorGreen
2922 return (float)GetValue(ColorGreenProperty);
2926 SetValue(ColorGreenProperty, value);
2927 NotifyPropertyChanged();
2932 /// The Blue component of View.Color.
2936 /// Animatable - This property can be animated using <c>Animation</c> class.
2939 [EditorBrowsable(EditorBrowsableState.Never)]
2940 public float ColorBlue
2944 return (float)GetValue(ColorBlueProperty);
2948 SetValue(ColorBlueProperty, value);
2949 NotifyPropertyChanged();
2954 /// Set the layout on this View. Replaces any existing Layout.
2957 /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
2959 /// <since_tizen> 6 </since_tizen>
2960 public LayoutItem Layout
2964 return GetValue(LayoutProperty) as LayoutItem;
2968 SetValue(LayoutProperty, value);
2972 private LayoutItem InternalLayout
2980 // Do nothing if layout provided is already set on this View.
2981 if (value == layout)
2986 LayoutingDisabled = false;
2989 // If new layout being set already has a owner then that owner receives a replacement default layout.
2990 // First check if the layout to be set already has a owner.
2991 if (value?.Owner != null)
2993 // Previous owner of the layout gets a default layout as a replacement.
2994 value.Owner.Layout = new AbsoluteLayout()
2996 // Copy Margin and Padding to replacement LayoutGroup.
2997 Margin = value.Margin,
2998 Padding = value.Padding,
3002 // Copy Margin and Padding to new layout being set or restore padding and margin back to
3003 // View if no replacement. Previously margin and padding values would have been moved from
3004 // the View to the layout.
3005 if (layout != null) // Existing layout
3009 // Existing layout being replaced so copy over margin and padding values.
3010 value.Margin = layout.Margin;
3011 value.Padding = layout.Padding;
3012 value.SetPositionByLayout = !excludeLayouting;
3016 // Layout not being replaced so restore margin and padding to View.
3017 SetValue(MarginProperty, layout.Margin);
3018 SetValue(PaddingProperty, layout.Padding);
3019 NotifyPropertyChanged();
3024 // First Layout to be added to the View hence copy
3026 // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
3029 Extents margin = Margin;
3030 Extents padding = Padding;
3031 bool setMargin = false;
3032 bool setPadding = false;
3034 if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
3036 // If View already has a margin set then store it in Layout instead.
3037 value.Margin = margin;
3038 SetValue(MarginProperty, new Extents(0, 0, 0, 0));
3042 if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
3044 // If View already has a padding set then store it in Layout instead.
3045 value.Padding = padding;
3046 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
3050 if (setMargin || setPadding)
3052 NotifyPropertyChanged();
3055 value.SetPositionByLayout = !excludeLayouting;
3059 // Remove existing layout from it's parent layout group.
3062 // Set layout to this view
3068 /// The weight of the View, used to share available space in a layout with siblings.
3070 /// <since_tizen> 6 </since_tizen>
3080 layout?.RequestLayout();
3085 /// Whether to load the BackgroundImage synchronously.
3086 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3087 /// Note: For Normal Quad images only.
3089 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
3090 [EditorBrowsable(EditorBrowsableState.Never)]
3091 public bool BackgroundImageSynchronosLoading
3095 return (bool)GetValue(BackgroundImageSynchronosLoadingProperty);
3099 SetValue(BackgroundImageSynchronosLoadingProperty, value);
3100 NotifyPropertyChanged();
3104 private bool InternalBackgroundImageSynchronosLoading
3108 return BackgroundImageSynchronousLoading;
3112 BackgroundImageSynchronousLoading = value;
3117 /// Whether to load the BackgroundImage synchronously.
3118 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3119 /// Note: For Normal Quad images only.
3121 /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3122 [EditorBrowsable(EditorBrowsableState.Never)]
3123 public bool BackgroundImageSynchronousLoading
3127 return (bool)GetValue(BackgroundImageSynchronousLoadingProperty);
3131 SetValue(BackgroundImageSynchronousLoadingProperty, value);
3132 NotifyPropertyChanged();
3136 private bool InternalBackgroundImageSynchronousLoading
3140 return backgroundImageSynchronousLoading;
3144 backgroundImageSynchronousLoading = value;
3146 #if NUI_VISUAL_PROPERTY_CHANGE_1
3147 if (!string.IsNullOrEmpty(BackgroundImage))
3149 string bgUrl = null;
3150 var pValue = Background.Find(ImageVisualProperty.URL);
3151 pValue?.Get(out bgUrl);
3154 if (!string.IsNullOrEmpty(bgUrl))
3157 PropertyMap bgMap = this.Background;
3158 var temp = new PropertyValue(backgroundImageSynchronousLoading);
3159 bgMap[ImageVisualProperty.SynchronousLoading] = temp;
3166 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3167 [EditorBrowsable(EditorBrowsableState.Never)]
3168 public Vector4 UpdateAreaHint
3172 return (Vector4)GetValue(UpdateAreaHintProperty);
3176 SetValue(UpdateAreaHintProperty, value);
3177 NotifyPropertyChanged();
3182 /// Enable/Disable ControlState propagation for children.
3183 /// It is false by default.
3184 /// If the View needs to share ControlState with descendants, please set it true.
3185 /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
3187 [EditorBrowsable(EditorBrowsableState.Never)]
3188 public bool EnableControlStatePropagation
3192 return (bool)GetValue(EnableControlStatePropagationProperty);
3196 SetValue(EnableControlStatePropagationProperty, value);
3197 NotifyPropertyChanged();
3201 private bool InternalEnableControlStatePropagation
3203 get => themeData?.ControlStatePropagation ?? false;
3206 if (InternalEnableControlStatePropagation == value) return;
3208 if (themeData == null) themeData = new ThemeData();
3210 themeData.ControlStatePropagation = value;
3212 foreach (View child in Children)
3214 child.EnableControlStatePropagation = value;
3220 /// The ControlStates can propagate from the parent.
3221 /// Listed ControlStates will be accepted propagation of the parent ControlState changes
3222 /// if parent view EnableControlState is true.
3223 /// <see cref="EnableControlState"/>.
3224 /// Default is ControlState.All, so every ControlStates will be propagated from the parent.
3226 [EditorBrowsable(EditorBrowsableState.Never)]
3227 public ControlState PropagatableControlStates
3231 return (ControlState)GetValue(PropagatableControlStatesProperty);
3235 SetValue(PropagatableControlStatesProperty, value);
3236 NotifyPropertyChanged();
3240 private ControlState InternalPropagatableControlStates
3242 get => propagatableControlStates;
3243 set => propagatableControlStates = value;
3247 /// By default, it is false in View, true in Control.
3248 /// Note that if the value is true, the View will be a touch receptor.
3250 [EditorBrowsable(EditorBrowsableState.Never)]
3251 public bool EnableControlState
3255 return (bool)GetValue(EnableControlStateProperty);
3259 SetValue(EnableControlStateProperty, value);
3264 /// Whether the actor grab all touches even if touch leaves its boundary.
3266 /// <returns>true, if it grab all touch after start</returns>
3267 [EditorBrowsable(EditorBrowsableState.Never)]
3268 public bool GrabTouchAfterLeave
3272 return (bool)GetValue(GrabTouchAfterLeaveProperty);
3276 SetValue(GrabTouchAfterLeaveProperty, value);
3280 private bool InternalGrabTouchAfterLeave
3284 #if NUI_VISUAL_PROPERTY_CHANGE_1
3285 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart);
3288 var pValue = GetProperty(View.Property.CaptureAllTouchAfterStart);
3289 pValue.Get(out temp);
3296 #if NUI_VISUAL_PROPERTY_CHANGE_1
3297 Object.InternalSetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart, value);
3299 var temp = new Tizen.NUI.PropertyValue(value);
3300 SetProperty(View.Property.CaptureAllTouchAfterStart, temp);
3303 NotifyPropertyChanged();
3308 /// Whether the view will only receive own touch.
3310 /// <returns>true, if it only receives touches that started from itself.</returns>
3311 [EditorBrowsable(EditorBrowsableState.Never)]
3312 public bool AllowOnlyOwnTouch
3316 return (bool)GetValue(AllowOnlyOwnTouchProperty);
3320 SetValue(AllowOnlyOwnTouchProperty, value);
3324 private bool InternalAllowOnlyOwnTouch
3328 #if NUI_VISUAL_PROPERTY_CHANGE_1
3329 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch);
3332 var pValue = GetProperty(View.Property.AllowOnlyOwnTouch);
3333 pValue.Get(out temp);
3340 #if NUI_VISUAL_PROPERTY_CHANGE_1
3341 Object.InternalSetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch, value);
3343 var temp = new Tizen.NUI.PropertyValue(value);
3344 SetProperty(View.Property.AllowOnlyOwnTouch, temp);
3347 NotifyPropertyChanged();
3352 /// Determines which blend equation will be used to render renderers of this actor.
3354 /// <returns>blend equation enum currently assigned</returns>
3355 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
3356 [EditorBrowsable(EditorBrowsableState.Never)]
3357 public BlendEquationType BlendEquation
3361 return (BlendEquationType)GetValue(BlendEquationProperty);
3365 SetValue(BlendEquationProperty, value);
3369 private BlendEquationType InternalBlendEquation
3373 #if NUI_VISUAL_PROPERTY_CHANGE_1
3374 return (BlendEquationType)Object.InternalGetPropertyInt(SwigCPtr, View.Property.BlendEquation);
3377 var pValue = GetProperty(View.Property.BlendEquation);
3378 pValue.Get(out temp);
3380 return (BlendEquationType)temp;
3385 #if NUI_VISUAL_PROPERTY_CHANGE_1
3386 Object.InternalSetPropertyInt(SwigCPtr, View.Property.BlendEquation, (int)value);
3388 var temp = new Tizen.NUI.PropertyValue((int)value);
3389 SetProperty(View.Property.BlendEquation, temp);
3392 NotifyPropertyChanged();
3397 /// If the value is true, the View will change its style as the theme changes.
3398 /// The default value is false in normal case but it can be true when the NUIApplication is created with <see cref="NUIApplication.ThemeOptions.ThemeChangeSensitive"/>.
3400 /// <since_tizen> 9 </since_tizen>
3401 public bool ThemeChangeSensitive
3403 get => (bool)GetValue(ThemeChangeSensitiveProperty);
3404 set => SetValue(ThemeChangeSensitiveProperty, value);
3408 /// Create Style, it is abstract function and must be override.
3410 [EditorBrowsable(EditorBrowsableState.Never)]
3411 protected virtual ViewStyle CreateViewStyle()
3413 return new ViewStyle();
3417 /// Called after the View's ControlStates changed.
3419 /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
3420 [EditorBrowsable(EditorBrowsableState.Never)]
3421 protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
3427 [EditorBrowsable(EditorBrowsableState.Never)]
3428 protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
3430 isThemeChanged = true;
3431 if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
3432 else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
3433 isThemeChanged = false;
3437 /// Apply style instance to the view.
3438 /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
3440 /// <since_tizen> 9 </since_tizen>
3441 public virtual void ApplyStyle(ViewStyle viewStyle)
3443 if (viewStyle == null || themeData?.viewStyle == viewStyle) return;
3445 if (themeData == null) themeData = new ThemeData();
3447 themeData.viewStyle = viewStyle;
3449 if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
3455 BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
3457 if (bindablePropertyOfView == null)
3462 var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
3463 viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
3465 foreach (var sourceProperty in dirtyStyleProperties)
3467 var sourceValue = viewStyle.GetValue(sourceProperty);
3469 if (sourceValue == null)
3474 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
3476 // Do not set value again when theme is changed and the value has been set already.
3477 if (isThemeChanged && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty))
3482 if (destinationProperty != null)
3484 InternalSetValue(destinationProperty, sourceValue);
3490 /// Get whether the View is culled or not.
3491 /// True means that the View is out of the view frustum.
3494 /// Hidden-API (Inhouse-API).
3496 [EditorBrowsable(EditorBrowsableState.Never)]
3501 #if NUI_VISUAL_PROPERTY_CHANGE_1
3502 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.Culled);
3505 var pValue = GetProperty(View.Property.Culled);
3506 pValue.Get(out temp);
3514 /// Set or Get TransitionOptions for the page transition.
3515 /// This property is used to define how this view will be transitioned during Page switching.
3517 /// <since_tizen> 9 </since_tizen>
3518 public TransitionOptions TransitionOptions
3522 return GetValue(TransitionOptionsProperty) as TransitionOptions;
3526 SetValue(TransitionOptionsProperty, value);
3527 NotifyPropertyChanged();
3531 private TransitionOptions InternalTransitionOptions
3535 transitionOptions = value;
3539 return transitionOptions;
3544 /// Gets or sets the status of whether the view should emit key event signals.
3545 /// If a View's DispatchKeyEvents is set to false, then itself and parents will not receive key event signals.
3547 [EditorBrowsable(EditorBrowsableState.Never)]
3548 public bool DispatchKeyEvents
3552 return (bool)GetValue(DispatchKeyEventsProperty);
3556 SetValue(DispatchKeyEventsProperty, value);
3557 NotifyPropertyChanged();
3562 /// Gets or sets the status of whether touch events can be dispatched.
3563 /// 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.
3564 /// This works without adding a TouchEvent callback in the View.
3566 /// 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.
3569 [EditorBrowsable(EditorBrowsableState.Never)]
3570 public bool DispatchTouchEvents
3574 return dispatchTouchEvents;
3578 if (dispatchTouchEvents != value)
3580 dispatchTouchEvents = value;
3581 if (dispatchTouchEvents == false)
3583 TouchEvent += OnDispatchTouchEvent;
3587 TouchEvent -= OnDispatchTouchEvent;
3593 private bool OnDispatchTouchEvent(object source, View.TouchEventArgs e)
3599 /// Gets or sets the status of whether the view should emit Gesture event signals.
3600 /// If a View's DispatchGestureEvents is set to false, then itself and parents will not receive all gesture event signals.
3601 /// The itself and parents does not receive tap, pinch, pan, rotation, or longpress gestures.
3603 [EditorBrowsable(EditorBrowsableState.Never)]
3604 public bool DispatchGestureEvents
3608 return dispatchGestureEvents;
3612 if (dispatchGestureEvents != value)
3614 dispatchGestureEvents = value;
3615 ConfigGestureDetector(dispatchGestureEvents);
3621 /// Gets or sets the status of whether the view should emit Gesture event signals.
3622 /// If a View's DispatchParentGestureEvents is set to false, then parents will not receive all gesture event signals.
3623 /// The parents does not receive tap, pinch, pan, rotation, or longpress gestures.
3625 [EditorBrowsable(EditorBrowsableState.Never)]
3626 public bool DispatchParentGestureEvents
3630 return dispatchParentGestureEvents;
3634 if (dispatchParentGestureEvents != value)
3636 dispatchParentGestureEvents = value;
3637 ConfigGestureDetector(dispatchParentGestureEvents);
3642 private void ConfigGestureDetector(bool dispatch)
3644 if (panGestureDetector == null) panGestureDetector = new PanGestureDetector();
3645 if (longGestureDetector == null) longGestureDetector = new LongPressGestureDetector();
3646 if (pinchGestureDetector == null) pinchGestureDetector = new PinchGestureDetector();
3647 if (tapGestureDetector == null) tapGestureDetector = new TapGestureDetector();
3648 if (rotationGestureDetector == null) rotationGestureDetector = new RotationGestureDetector();
3650 if (dispatch == true)
3652 configGestureCount = configGestureCount > 0 ? configGestureCount-- : 0;
3653 if (configGestureCount == 0)
3655 panGestureDetector.Detach(this);
3656 longGestureDetector.Detach(this);
3657 pinchGestureDetector.Detach(this);
3658 tapGestureDetector.Detach(this);
3659 rotationGestureDetector.Detach(this);
3661 panGestureDetector.Detected -= OnGestureDetected;
3662 longGestureDetector.Detected -= OnGestureDetected;
3663 pinchGestureDetector.Detected -= OnGestureDetected;
3664 tapGestureDetector.Detected -= OnGestureDetected;
3665 rotationGestureDetector.Detected -= OnGestureDetected;
3667 panGestureDetector = null;
3668 longGestureDetector = null;
3669 pinchGestureDetector = null;
3670 tapGestureDetector = null;
3671 rotationGestureDetector = null;
3676 if (configGestureCount == 0)
3678 panGestureDetector.Attach(this);
3679 longGestureDetector.Attach(this);
3680 pinchGestureDetector.Attach(this);
3681 tapGestureDetector.Attach(this);
3682 rotationGestureDetector.Attach(this);
3684 panGestureDetector.Detected += OnGestureDetected;
3685 longGestureDetector.Detected += OnGestureDetected;
3686 pinchGestureDetector.Detected += OnGestureDetected;
3687 tapGestureDetector.Detected += OnGestureDetected;
3688 rotationGestureDetector.Detected += OnGestureDetected;
3690 configGestureCount++;
3694 private void OnGestureDetected(object source, EventArgs e)
3696 // Does notting. This is to consume the gesture.
3700 /// Called when the view is hit through TouchEvent or GestureEvent.
3701 /// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
3702 /// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
3703 /// User can override whether hit or not in HitTest.
3704 /// You can get the coordinates relative to tthe top-left of the hit view by touch.GetLocalPosition(0).
3705 /// or you can get the coordinates relative to the top-left of the screen by touch.GetScreenPosition(0).
3707 // <param name="touch"><see cref="Tizen.NUI.Touch"/>The touch data</param>
3708 [EditorBrowsable(EditorBrowsableState.Never)]
3709 protected virtual bool HitTest(Touch touch)
3715 /// Retrieve the View's current Color.
3718 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3719 /// 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).
3720 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3721 /// and users can get the current actual values through them.
3723 [EditorBrowsable(EditorBrowsableState.Never)]
3724 public Color CurrentColor => GetCurrentColor();
3727 /// Retrieve the current scale factor applied to the View.
3730 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3731 /// 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).
3732 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3733 /// and users can get the current actual values through them.
3735 [EditorBrowsable(EditorBrowsableState.Never)]
3736 public Vector3 CurrentScale => GetCurrentScale();