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;
74 private bool dispatchTouchEvents = true;
76 #if NUI_PROPERTY_CHANGE_DEBUG
77 internal static int LayoutSetGetter = 0;
78 internal static int SizeGetter = 0;
79 internal static int SizeSetter = 0;
80 internal static int Size2DGetter = 0;
81 internal static int Size2DSetter = 0;
82 internal static int MaximumSizeGetter = 0;
83 internal static int MaximumSizeSetter = 0;
84 internal static int MinimumSizeGetter = 0;
85 internal static int MinimumSizeSetter = 0;
86 internal static int PositionGetter = 0;
87 internal static int PositionSetter = 0;
88 internal static int Position2DGetter = 0;
89 internal static int Position2DSetter = 0;
90 internal static int SizeWidthGetter = 0;
91 internal static int SizeWidthSetter = 0;
92 internal static int SizeHeightGetter = 0;
93 internal static int SizeHeightSetter = 0;
94 internal static int PositionXGetter = 0;
95 internal static int PositionXSetter = 0;
96 internal static int PositionYGetter = 0;
97 internal static int PositionYSetter = 0;
98 internal static int PositionZGetter = 0;
99 internal static int PositionZSetter = 0;
104 RegisterPropertyGroup(PositionProperty, positionPropertyGroup);
105 RegisterPropertyGroup(Position2DProperty, positionPropertyGroup);
106 RegisterPropertyGroup(PositionXProperty, positionPropertyGroup);
107 RegisterPropertyGroup(PositionYProperty, positionPropertyGroup);
109 RegisterPropertyGroup(SizeProperty, sizePropertyGroup);
110 RegisterPropertyGroup(Size2DProperty, sizePropertyGroup);
111 RegisterPropertyGroup(SizeWidthProperty, sizePropertyGroup);
112 RegisterPropertyGroup(SizeHeightProperty, sizePropertyGroup);
114 RegisterPropertyGroup(ScaleProperty, scalePropertyGroup);
115 RegisterPropertyGroup(ScaleXProperty, scalePropertyGroup);
116 RegisterPropertyGroup(ScaleYProperty, scalePropertyGroup);
117 RegisterPropertyGroup(ScaleZProperty, scalePropertyGroup);
119 RegisterAccessibilityDelegate();
123 /// Creates a new instance of a view.
125 /// <since_tizen> 3 </since_tizen>
126 public View() : this(Interop.View.New(), true)
128 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
131 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
132 [EditorBrowsable(EditorBrowsableState.Never)]
133 public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
138 /// Create a new instance of a View with setting the status of shown or hidden.
140 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
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(bool shown) : this(Interop.View.New(), true)
145 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
149 internal View(View uiControl, bool shown = true) : this(Interop.View.NewView(View.getCPtr(uiControl)), true)
151 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157 backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
160 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
162 InitializeStyle(viewStyle);
165 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn)
169 PositionUsesPivotPoint = false;
172 onWindowSendEventCallback = SendViewAddedEventToWindow;
173 using ViewSignal signal = new ViewSignal(Interop.ActorSignal.ActorOnSceneSignal(SwigCPtr), false);
174 signal?.Connect(onWindowSendEventCallback);
176 hitTestResultDataCallback = OnHitTestResult;
177 using TouchDataSignal touchDataSignal = new TouchDataSignal(Interop.ActorSignal.ActorHitTestResultSignal(SwigCPtr), false);
178 touchDataSignal?.Connect(hitTestResultDataCallback);
185 GrabTouchAfterLeave = defaultGrabTouchAfterLeave;
186 AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch;
189 internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
191 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
200 /// The event that is triggered when the View's ControlState is changed.
202 [EditorBrowsable(EditorBrowsableState.Never)]
203 public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
205 internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
209 /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
211 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
212 [EditorBrowsable(EditorBrowsableState.Never)]
213 public bool LayoutSet
217 #if NUI_PROPERTY_CHANGE_DEBUG
225 /// Flag to allow Layouting to be disabled for Views.
226 /// Once a View has a Layout set then any children added to Views from then on will receive
227 /// automatic Layouts.
229 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
230 [EditorBrowsable(EditorBrowsableState.Never)]
231 public static bool LayoutingDisabled { get; set; } = true;
234 /// If set to true, the <see cref="GrabTouchAfterLeave"/> property value is set to true when all Views are created.
236 /// <param name="enable">Sets value of GrabTouchAfterLeave property</param>
237 [EditorBrowsable(EditorBrowsableState.Never)]
238 public static void SetDefaultGrabTouchAfterLeave(bool enable)
240 defaultGrabTouchAfterLeave = enable;
244 /// If set to true, the <see cref="AllowOnlyOwnTouch"/> property value is set to true when all Views are created.
246 /// <param name="enable">Sets value of AllowOnlyOwnTouch property</param>
247 [EditorBrowsable(EditorBrowsableState.Never)]
248 public static void SetDefaultAllowOnlyOwnTouch(bool enable)
250 defaultAllowOnlyOwnTouch = enable;
254 /// Deprecate. Do not use this.
255 /// The style instance applied to this view.
256 /// Note that do not modify the ViewStyle.
257 /// Modifying ViewStyle will affect other views with same ViewStyle.
259 [EditorBrowsable(EditorBrowsableState.Never)]
260 protected ViewStyle ViewStyle
264 if (themeData == null) themeData = new ThemeData();
266 if (themeData.viewStyle == null)
268 ApplyStyle(CreateViewStyle());
270 return themeData.viewStyle;
275 /// Get/Set the control state.
276 /// Note that the ControlState only available for the classes derived from Control.
277 /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
278 /// please set <see cref="EnableControlState"/> to true.
280 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
281 [EditorBrowsable(EditorBrowsableState.Never)]
282 public ControlState ControlState
286 return themeData == null ? ControlState.Normal : themeData.controlStates;
290 if (ControlState == value)
295 var prevState = ControlState;
297 if (themeData == null) themeData = new ThemeData();
298 themeData.controlStates = value;
300 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
302 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
304 if (themeData.ControlStatePropagation)
306 foreach (View child in Children)
308 ControlState allowed = child.PropagatableControlStates;
309 if (allowed.Contains(ControlState.All))
311 child.ControlState = value;
315 ControlState newControlState = child.ControlState;
317 if (allowed.Contains(ControlState.Normal))
319 if (value.Contains(ControlState.Normal))
321 newControlState += ControlState.Normal;
325 newControlState -= ControlState.Normal;
329 if (allowed.Contains(ControlState.Disabled))
331 if (value.Contains(ControlState.Disabled))
333 newControlState += ControlState.Disabled;
337 newControlState -= ControlState.Disabled;
341 if (allowed.Contains(ControlState.Selected))
343 if (value.Contains(ControlState.Selected))
345 newControlState += ControlState.Selected;
349 newControlState -= ControlState.Selected;
353 if (allowed.Contains(ControlState.Pressed))
355 if (value.Contains(ControlState.Pressed))
357 newControlState += ControlState.Pressed;
361 newControlState -= ControlState.Pressed;
365 if (allowed.Contains(ControlState.Focused))
367 if (value.Contains(ControlState.Focused))
369 newControlState += ControlState.Focused;
373 newControlState -= ControlState.Focused;
377 if (allowed.Contains(ControlState.Other))
379 if (value.Contains(ControlState.Other))
381 newControlState += ControlState.Other;
385 newControlState -= ControlState.Other;
389 if (child.ControlState != newControlState)
390 child.ControlState = newControlState;
395 OnControlStateChanged(changeInfo);
397 ControlStateChangedEvent?.Invoke(this, changeInfo);
402 /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
404 /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
405 [EditorBrowsable(EditorBrowsableState.Never)]
406 public bool ExcludeLayouting
410 return (bool)GetValue(ExcludeLayoutingProperty);
414 SetValue(ExcludeLayoutingProperty, value);
415 NotifyPropertyChanged();
419 private bool InternalExcludeLayouting
423 return excludeLayouting;
427 excludeLayouting = value;
428 if (Layout != null && Layout.SetPositionByLayout == value)
430 Layout.SetPositionByLayout = !value;
431 Layout.RequestLayout();
437 /// The StyleName, type string.
438 /// The value indicates DALi style name defined in json theme file.
440 /// <since_tizen> 3 </since_tizen>
441 public string StyleName
445 return (string)GetValue(StyleNameProperty);
449 SetValue(StyleNameProperty, value);
450 NotifyPropertyChanged();
455 /// The KeyInputFocus, type bool.
457 [EditorBrowsable(EditorBrowsableState.Never)]
458 public bool KeyInputFocus
462 return (bool)GetValue(KeyInputFocusProperty);
466 SetValue(KeyInputFocusProperty, value);
467 NotifyPropertyChanged();
472 /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
476 /// The property cascade chaining set is not recommended.
479 /// Animatable - This property can be animated using <c>Animation</c> class.
481 /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
486 /// This way is recommended for setting the property
488 /// var view = new View();
489 /// view.BackgroundColor = new Color(0.5f, 0.1f, 0, 1);
491 /// This way to set the property is prohibited
493 /// view.BackgroundColor.R = 0.5f; //This does not guarantee a proper operation
496 /// <since_tizen> 3 </since_tizen>
497 public Color BackgroundColor
501 return (Color)GetValue(BackgroundColorProperty);
505 SetValue(BackgroundColorProperty, value);
506 NotifyPropertyChanged();
511 /// The mutually exclusive with "backgroundColor" and "background" type Map.
513 /// <since_tizen> 3 </since_tizen>
514 public string BackgroundImage
518 return (string)GetValue(BackgroundImageProperty);
522 SetValue(BackgroundImageProperty, value);
523 NotifyPropertyChanged();
528 /// Get or set the border of background image.
530 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
531 [EditorBrowsable(EditorBrowsableState.Never)]
532 public Rectangle BackgroundImageBorder
536 return (Rectangle)GetValue(BackgroundImageBorderProperty);
540 SetValue(BackgroundImageBorderProperty, value);
541 NotifyPropertyChanged();
546 /// The background of view.
548 /// <since_tizen> 3 </since_tizen>
549 public Tizen.NUI.PropertyMap Background
553 return (PropertyMap)GetValue(BackgroundProperty);
557 SetValue(BackgroundProperty, value);
558 NotifyPropertyChanged();
563 /// Describes a shadow as an image for a View.
564 /// It is null by default.
567 /// Getter returns copied instance of current shadow.
570 /// The mutually exclusive with "BoxShadow".
574 /// Animatable - This property can be animated using <c>Animation</c> class.
575 /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
577 /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
579 /// Animatable sub-property : Offset.
582 [EditorBrowsable(EditorBrowsableState.Never)]
583 public ImageShadow ImageShadow
587 return (ImageShadow)GetValue(ImageShadowProperty);
591 SetValue(ImageShadowProperty, value);
592 NotifyPropertyChanged();
597 /// Describes a box shaped shadow drawing for a View.
598 /// It is null by default.
601 /// The mutually exclusive with "ImageShadow".
605 /// Animatable - This property can be animated using <c>Animation</c> class.
606 /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
608 /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
610 /// Animatable sub-property : Offset, Color, BlurRadius.
613 /// <since_tizen> 9 </since_tizen>
614 public Shadow BoxShadow
618 return (Shadow)GetValue(BoxShadowProperty);
622 SetValue(BoxShadowProperty, value);
623 NotifyPropertyChanged();
628 /// The radius for the rounded corners of the View.
629 /// This will rounds background and shadow edges.
630 /// 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).
631 /// Each radius will clamp internally to the half of smaller of the view's width or height.
632 /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
636 /// Animatable - This property can be animated using <c>Animation</c> class.
638 /// animation.AnimateTo(view, "CornerRadius", new Vector4(10, 10, 10, 10));
642 /// <since_tizen> 9 </since_tizen>
643 public Vector4 CornerRadius
647 return (Vector4)GetValue(CornerRadiusProperty);
651 SetValue(CornerRadiusProperty, value);
652 NotifyPropertyChanged();
657 /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
658 /// It is absolute by default.
659 /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
661 /// <since_tizen> 9 </since_tizen>
662 public VisualTransformPolicyType CornerRadiusPolicy
664 get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
665 set => SetValue(CornerRadiusPolicyProperty, value);
669 /// The width for the borderline of the View.
673 /// Animatable - This property can be animated using <c>Animation</c> class.
675 /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
678 /// Note that, an image background may not have borderline if it uses the Border property.
680 /// <since_tizen> 9 </since_tizen>
681 public float BorderlineWidth
685 return (float)GetValue(BorderlineWidthProperty);
689 SetValue(BorderlineWidthProperty, value);
690 NotifyPropertyChanged();
695 /// The color for the borderline of the View.
696 /// It is Color.Black by default.
700 /// Animatable - This property can be animated using <c>Animation</c> class.
702 /// animation.AnimateTo(view, "BorderlineColor", new Color(r, g, b, a));
706 /// <since_tizen> 9 </since_tizen>
707 public Color BorderlineColor
711 return (Color)GetValue(BorderlineColorProperty);
715 SetValue(BorderlineColorProperty, value);
716 NotifyPropertyChanged();
721 /// The color selector for the borderline of the View.
722 /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
723 /// So this API is internally used only.
725 internal Selector<Color> BorderlineColorSelector
729 return (Selector<Color>)GetValue(BorderlineColorSelectorProperty);
733 SetValue(BorderlineColorSelectorProperty, value);
734 NotifyPropertyChanged();
739 /// The Relative offset for the borderline of the View.
740 /// Recommended range : [-1.0f to 1.0f].
741 /// If -1.0f, draw borderline inside of the View.
742 /// If 1.0f, draw borderline outside of the View.
743 /// If 0.0f, draw borderline half inside and half outside.
744 /// It is 0.0f by default.
748 /// Animatable - This property can be animated using <c>Animation</c> class.
750 /// animation.AnimateTo(view, "BorderlineOffset", -1.0f);
754 /// <since_tizen> 9 </since_tizen>
755 public float BorderlineOffset
759 return (float)GetValue(BorderlineOffsetProperty);
763 SetValue(BorderlineOffsetProperty, value);
764 NotifyPropertyChanged();
769 /// The current state of the view.
771 /// <since_tizen> 3 </since_tizen>
776 return (States)GetValue(StateProperty);
780 SetValue(StateProperty, value);
781 NotifyPropertyChanged();
786 /// The current sub state of the view.
788 /// <since_tizen> 3 </since_tizen>
789 public States SubState
793 return (States)GetValue(SubStateProperty);
797 SetValue(SubStateProperty, value);
798 NotifyPropertyChanged();
803 /// Displays a tooltip
805 /// <since_tizen> 3 </since_tizen>
806 public Tizen.NUI.PropertyMap Tooltip
810 return (PropertyMap)GetValue(TooltipProperty);
814 SetValue(TooltipProperty, value);
815 NotifyPropertyChanged();
820 /// Displays a tooltip as a text.
822 /// <since_tizen> 3 </since_tizen>
823 public string TooltipText
827 return GetValue(TooltipTextProperty) as string;
831 SetValue(TooltipTextProperty, value);
835 private string InternalTooltipText
839 using (var propertyValue = GetProperty(Property.TOOLTIP))
841 if (propertyValue != null && propertyValue.Get(out string retrivedValue))
843 return retrivedValue;
845 NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
846 return "error to get TooltipText";
851 var temp = new Tizen.NUI.PropertyValue(value);
852 SetProperty(View.Property.TOOLTIP, temp);
854 NotifyPropertyChanged();
859 /// The Child property of FlexContainer.<br />
860 /// The proportion of the free space in the container, the flex item will receive.<br />
861 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
863 /// <since_tizen> 3 </since_tizen>
864 [Obsolete("Deprecated in API8, will be removed in API10.")]
869 return (float)GetValue(FlexProperty);
873 SetValue(FlexProperty, value);
874 NotifyPropertyChanged();
879 /// The Child property of FlexContainer.<br />
880 /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
882 /// <since_tizen> 3 </since_tizen>
883 [Obsolete("Deprecated in API8, will be removed in API10.")]
888 return (int)GetValue(AlignSelfProperty);
892 SetValue(AlignSelfProperty, value);
893 NotifyPropertyChanged();
898 /// The Child property of FlexContainer.<br />
899 /// The space around the flex item.<br />
902 /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
904 /// <since_tizen> 3 </since_tizen>
905 [Obsolete("Deprecated in API8, will be removed in API10.")]
906 public Vector4 FlexMargin
910 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
911 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
915 SetValue(FlexMarginProperty, value);
916 NotifyPropertyChanged();
921 /// The top-left cell this child occupies, if not set, the first available cell is used.
924 /// The property cascade chaining set is not recommended.
925 /// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
928 /// This way is recommended for setting the property
930 /// var view = new View();
931 /// view.CellIndex = new Vector2(1, 3);
933 /// This way to set the property is prohibited
935 /// view.CellIndex.X = 1; //This does not guarantee a proper operation
938 /// <since_tizen> 3 </since_tizen>
939 public Vector2 CellIndex
943 return (Vector2)GetValue(CellIndexProperty);
947 SetValue(CellIndexProperty, value);
948 NotifyPropertyChanged();
953 /// The number of rows this child occupies, if not set, the default value is 1.
956 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
958 /// <since_tizen> 3 </since_tizen>
963 return (float)GetValue(RowSpanProperty);
967 SetValue(RowSpanProperty, value);
968 NotifyPropertyChanged();
973 /// The number of columns this child occupies, if not set, the default value is 1.
976 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
978 /// <since_tizen> 3 </since_tizen>
979 public float ColumnSpan
983 return (float)GetValue(ColumnSpanProperty);
987 SetValue(ColumnSpanProperty, value);
988 NotifyPropertyChanged();
993 /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
996 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
998 /// <since_tizen> 3 </since_tizen>
999 public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
1003 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
1007 SetValue(CellHorizontalAlignmentProperty, value);
1008 NotifyPropertyChanged();
1013 /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
1016 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1018 /// <since_tizen> 3 </since_tizen>
1019 public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
1023 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
1027 SetValue(CellVerticalAlignmentProperty, value);
1028 NotifyPropertyChanged();
1033 /// The left focusable view.<br />
1034 /// This will return null if not set.<br />
1035 /// This will also return null if the specified left focusable view is not on a window.<br />
1037 /// <since_tizen> 3 </since_tizen>
1038 public View LeftFocusableView
1040 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1043 return (View)GetValue(LeftFocusableViewProperty);
1047 SetValue(LeftFocusableViewProperty, value);
1048 NotifyPropertyChanged();
1053 /// The right focusable view.<br />
1054 /// This will return null if not set.<br />
1055 /// This will also return null if the specified right focusable view is not on a window.<br />
1057 /// <since_tizen> 3 </since_tizen>
1058 public View RightFocusableView
1060 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1063 return (View)GetValue(RightFocusableViewProperty);
1067 SetValue(RightFocusableViewProperty, value);
1068 NotifyPropertyChanged();
1073 /// The up focusable view.<br />
1074 /// This will return null if not set.<br />
1075 /// This will also return null if the specified up focusable view is not on a window.<br />
1077 /// <since_tizen> 3 </since_tizen>
1078 public View UpFocusableView
1080 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1083 return (View)GetValue(UpFocusableViewProperty);
1087 SetValue(UpFocusableViewProperty, value);
1088 NotifyPropertyChanged();
1093 /// The down focusable view.<br />
1094 /// This will return null if not set.<br />
1095 /// This will also return null if the specified down focusable view is not on a window.<br />
1097 /// <since_tizen> 3 </since_tizen>
1098 public View DownFocusableView
1100 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1103 return (View)GetValue(DownFocusableViewProperty);
1107 SetValue(DownFocusableViewProperty, value);
1108 NotifyPropertyChanged();
1113 /// The clockwise focusable view by rotary wheel.<br />
1114 /// This will return null if not set.<br />
1115 /// This will also return null if the specified clockwise focusable view is not on a window.<br />
1117 [EditorBrowsable(EditorBrowsableState.Never)]
1118 public View ClockwiseFocusableView
1120 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1123 return (View)GetValue(ClockwiseFocusableViewProperty);
1127 SetValue(ClockwiseFocusableViewProperty, value);
1128 NotifyPropertyChanged();
1133 /// The counter clockwise focusable view by rotary wheel.<br />
1134 /// This will return null if not set.<br />
1135 /// This will also return null if the specified counter clockwise focusable view is not on a window.<br />
1137 [EditorBrowsable(EditorBrowsableState.Never)]
1138 public View CounterClockwiseFocusableView
1140 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1143 return (View)GetValue(CounterClockwiseFocusableViewProperty);
1147 SetValue(CounterClockwiseFocusableViewProperty, value);
1148 NotifyPropertyChanged();
1153 /// Whether the view should be focusable by keyboard navigation.
1155 /// <since_tizen> 3 </since_tizen>
1156 public bool Focusable
1160 SetValue(FocusableProperty, value);
1161 NotifyPropertyChanged();
1165 return (bool)GetValue(FocusableProperty);
1170 /// 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.
1171 /// Note : Default value is true.
1173 [EditorBrowsable(EditorBrowsableState.Never)]
1174 public bool FocusableChildren
1178 SetValue(FocusableChildrenProperty, value);
1179 NotifyPropertyChanged();
1183 return (bool)GetValue(FocusableChildrenProperty);
1188 /// Whether this view can focus by touch.
1189 /// If Focusable is false, FocusableInTouch is disabled.
1190 /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
1192 [EditorBrowsable(EditorBrowsableState.Never)]
1193 public bool FocusableInTouch
1197 SetValue(FocusableInTouchProperty, value);
1198 NotifyPropertyChanged();
1202 return (bool)GetValue(FocusableInTouchProperty);
1207 /// Retrieves the position of the view.
1208 /// The coordinates are relative to the view's parent.
1211 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1212 /// 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).
1213 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1214 /// and users can get the current actual values through them.
1216 /// <since_tizen> 3 </since_tizen>
1217 public Position CurrentPosition
1221 return GetCurrentPosition();
1226 /// Sets the size of a view for the width and the height.<br />
1227 /// Geometry can be scaled to fit within this area.<br />
1228 /// This does not interfere with the view's scale factor.<br />
1229 /// The views default depth is the minimum of width and height.<br />
1232 /// The property cascade chaining set is not recommended.
1235 /// This way is recommended for setting the property
1237 /// var view = new View();
1238 /// view.Size2D = new Size2D(100, 200);
1240 /// This way to set the property is prohibited
1242 /// view.Size2D.Width = 100; //This does not guarantee a proper operation
1245 /// <since_tizen> 3 </since_tizen>
1246 public Size2D Size2D
1250 #if NUI_PROPERTY_CHANGE_DEBUG
1254 var temp = (Size2D)GetValue(Size2DProperty);
1256 if (this.Layout == null)
1258 if (temp.Width < 0) { temp.Width = 0; }
1259 if (temp.Height < 0) { temp.Height = 0; }
1266 #if NUI_PROPERTY_CHANGE_DEBUG
1270 SetValue(Size2DProperty, value);
1272 NotifyPropertyChanged();
1277 /// Retrieves the size of the view.
1278 /// The coordinates are relative to the view's parent.
1281 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1282 /// 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).
1283 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1284 /// and users can get the current actual values through them.
1286 /// <since_tizen> 3 </since_tizen>
1287 public Size2D CurrentSize
1291 return GetCurrentSize();
1296 /// Retrieves and sets the view's opacity.<br />
1300 /// Animatable - This property can be animated using <c>Animation</c> class.
1302 /// animation.AnimateTo(view, "Opacity", 0.5f);
1306 /// <since_tizen> 3 </since_tizen>
1307 public float Opacity
1311 return (float)GetValue(OpacityProperty);
1315 SetValue(OpacityProperty, value);
1316 NotifyPropertyChanged();
1321 /// Sets the position of the view for X and Y.<br />
1322 /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1323 /// If the position inheritance is disabled, sets the world position.<br />
1326 /// The property cascade chaining set is not recommended.
1329 /// This way is recommended for setting the property
1331 /// var view = new View();
1332 /// view.Position2D = new Position2D(100, 200);
1334 /// This way to set the property is prohibited
1336 /// view.Position2D.X = 100; //This does not guarantee a proper operation
1339 /// <since_tizen> 3 </since_tizen>
1340 public Position2D Position2D
1344 #if NUI_PROPERTY_CHANGE_DEBUG
1348 return (Position2D)GetValue(Position2DProperty);
1352 #if NUI_PROPERTY_CHANGE_DEBUG
1356 SetValue(Position2DProperty, value);
1357 NotifyPropertyChanged();
1362 /// Retrieves the screen position of the view.<br />
1364 /// <since_tizen> 3 </since_tizen>
1365 public Vector2 ScreenPosition
1369 Vector2 temp = new Vector2(0.0f, 0.0f);
1370 var pValue = GetProperty(View.Property.ScreenPosition);
1378 /// Determines whether the pivot point should be used to determine the position of the view.
1379 /// This is false by default.
1381 /// <remarks>If false, then the top-left of the view is used for the position.
1382 /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1384 /// <since_tizen> 3 </since_tizen>
1385 public bool PositionUsesPivotPoint
1389 return (bool)GetValue(PositionUsesPivotPointProperty);
1393 SetValue(PositionUsesPivotPointProperty, value);
1394 NotifyPropertyChanged();
1399 /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead.
1401 /// <since_tizen> 3 </since_tizen>
1402 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PositionUsesPivotPoint instead. " +
1404 "View view = new View(); " +
1405 "view.PivotPoint = PivotPoint.Center; " +
1406 "view.PositionUsesPivotPoint = true;" +
1407 " This has been deprecated in API5 and will be removed in API8")]
1408 [EditorBrowsable(EditorBrowsableState.Never)]
1409 public bool PositionUsesAnchorPoint
1413 return (bool)GetValue(PositionUsesAnchorPointProperty);
1417 SetValue(PositionUsesAnchorPointProperty, value);
1421 private bool InternalPositionUsesAnchorPoint
1426 var pValue = GetProperty(View.Property.PositionUsesAnchorPoint);
1427 pValue.Get(out temp);
1433 var temp = new Tizen.NUI.PropertyValue(value);
1434 SetProperty(View.Property.PositionUsesAnchorPoint, temp);
1436 NotifyPropertyChanged();
1441 /// Queries whether the view is connected to the stage.<br />
1442 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1444 /// <since_tizen> 3 </since_tizen>
1445 public bool IsOnWindow
1454 /// Gets the depth in the hierarchy for the view.
1456 /// <since_tizen> 3 </since_tizen>
1457 public int HierarchyDepth
1461 return GetHierarchyDepth();
1466 /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1469 /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1470 /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1471 /// The values set by this property will likely change.
1473 /// <since_tizen> 3 </since_tizen>
1474 public int SiblingOrder
1478 return (int)GetValue(SiblingOrderProperty);
1482 SetValue(SiblingOrderProperty, value);
1484 Layout?.ChangeLayoutSiblingOrder(value);
1486 NotifyPropertyChanged();
1491 /// Returns the natural size of the view.
1494 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1496 /// <since_tizen> 5 </since_tizen>
1497 public Vector3 NaturalSize
1501 Vector3 ret = GetNaturalSize();
1502 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1508 /// Returns the natural size (Size2D) of the view.
1511 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1513 /// <since_tizen> 4 </since_tizen>
1514 public Size2D NaturalSize2D
1518 Vector3 temp = GetNaturalSize();
1519 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1521 Size2D sz = new Size2D((int)temp.Width, (int)temp.Height);
1528 /// Gets or sets the origin of a view within its parent's area.<br />
1529 /// 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 />
1530 /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1531 /// A view's position is the distance between this origin and the view's anchor-point.<br />
1533 /// <pre>The view has been initialized.</pre>
1534 /// <since_tizen> 3 </since_tizen>
1535 public Position ParentOrigin
1539 Position tmp = (Position)GetValue(ParentOriginProperty);
1540 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1544 SetValue(ParentOriginProperty, value);
1545 NotifyPropertyChanged();
1550 /// Gets or sets the anchor-point of a view.<br />
1551 /// 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 />
1552 /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1553 /// A view position is the distance between its parent-origin and this anchor-point.<br />
1554 /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1555 /// <pre>The view has been initialized.</pre>
1558 /// The property cascade chaining set is not recommended.
1561 /// This way is recommended for setting the property
1563 /// var view = new View();
1564 /// view.PivotPoint = PivotPoint.Center;
1566 /// This way to set the property is prohibited
1568 /// view.PivotPoint.X = 0.5f; //This does not guarantee a proper operation
1571 /// <since_tizen> 3 </since_tizen>
1572 public Position PivotPoint
1576 return (Position)GetValue(PivotPointProperty);
1580 SetValue(PivotPointProperty, value);
1581 NotifyPropertyChanged();
1586 /// Gets or sets the size width of the view.
1590 /// Animatable - This property can be animated using <c>Animation</c> class.
1592 /// animation.AnimateTo(view, "SizeWidth", 500.0f);
1596 /// <since_tizen> 3 </since_tizen>
1597 public float SizeWidth
1601 #if NUI_PROPERTY_CHANGE_DEBUG
1605 return (float)GetValue(SizeWidthProperty);
1609 #if NUI_PROPERTY_CHANGE_DEBUG
1613 SetValue(SizeWidthProperty, value);
1614 NotifyPropertyChanged();
1619 /// Gets or sets the size height of the view.
1623 /// Animatable - This property can be animated using <c>Animation</c> class.
1626 /// animation.AnimateTo(view, "SizeHeight", 500.0f);
1629 /// <since_tizen> 3 </since_tizen>
1630 public float SizeHeight
1634 #if NUI_PROPERTY_CHANGE_DEBUG
1638 return (float)GetValue(SizeHeightProperty);
1642 #if NUI_PROPERTY_CHANGE_DEBUG
1646 SetValue(SizeHeightProperty, value);
1647 NotifyPropertyChanged();
1652 /// Gets or sets the position of the view.<br />
1653 /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1654 /// If the position inheritance is disabled, sets the world position.<br />
1658 /// Animatable - This property can be animated using <c>Animation</c> class.
1660 /// animation.AnimateTo(view, "Position", new Position(50, 0));
1663 /// The property cascade chaining set is not recommended.
1666 /// This way is recommended for setting the property
1668 /// var view = new View();
1669 /// view.Position = new Position(100, 200.5f, 0);
1671 /// This way to set the property is prohibited
1673 /// view.Position.Y = 200.5f; //This does not guarantee a proper operation
1676 /// <since_tizen> 3 </since_tizen>
1677 public Position Position
1681 #if NUI_PROPERTY_CHANGE_DEBUG
1685 return (Position)GetValue(PositionProperty);
1689 #if NUI_PROPERTY_CHANGE_DEBUG
1693 SetValue(PositionProperty, value);
1694 NotifyPropertyChanged();
1699 /// Gets or sets the position X of the view.
1703 /// Animatable - This property can be animated using <c>Animation</c> class.
1705 /// animation.AnimateTo(view, "PositionX", 50.0f);
1709 /// <since_tizen> 3 </since_tizen>
1710 public float PositionX
1714 #if NUI_PROPERTY_CHANGE_DEBUG
1717 return (float)GetValue(PositionXProperty);
1721 #if NUI_PROPERTY_CHANGE_DEBUG
1724 SetValue(PositionXProperty, value);
1725 NotifyPropertyChanged();
1730 /// Gets or sets the position Y of the view.
1734 /// Animatable - This property can be animated using <c>Animation</c> class.
1736 /// animation.AnimateTo(view, "PositionY", 50.0f);
1740 /// <since_tizen> 3 </since_tizen>
1741 public float PositionY
1745 #if NUI_PROPERTY_CHANGE_DEBUG
1748 return (float)GetValue(PositionYProperty);
1752 #if NUI_PROPERTY_CHANGE_DEBUG
1755 SetValue(PositionYProperty, value);
1756 NotifyPropertyChanged();
1761 /// Gets or sets the position Z of the view.
1765 /// Animatable - This property can be animated using <c>Animation</c> class.
1767 /// animation.AnimateTo(view, "PositionZ", 50.0f);
1771 /// <since_tizen> 3 </since_tizen>
1772 public float PositionZ
1776 #if NUI_PROPERTY_CHANGE_DEBUG
1780 return (float)GetValue(PositionZProperty);
1784 #if NUI_PROPERTY_CHANGE_DEBUG
1788 SetValue(PositionZProperty, value);
1789 NotifyPropertyChanged();
1794 /// Gets or sets the world position of the view.
1796 /// <since_tizen> 3 </since_tizen>
1797 public Vector3 WorldPosition
1801 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1802 var pValue = GetProperty(View.Property.WorldPosition);
1810 /// Gets or sets the orientation of the view.<br />
1811 /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1815 /// This is an asynchronous method.
1818 /// Animatable - This property can be animated using <c>Animation</c> class.
1820 /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
1824 /// <since_tizen> 3 </since_tizen>
1825 public Rotation Orientation
1829 return (Rotation)GetValue(OrientationProperty);
1833 SetValue(OrientationProperty, value);
1834 NotifyPropertyChanged();
1839 /// Gets or sets the world orientation of the view.<br />
1841 /// <since_tizen> 3 </since_tizen>
1842 public Rotation WorldOrientation
1846 Rotation temp = new Rotation();
1847 var pValue = GetProperty(View.Property.WorldOrientation);
1855 /// Gets or sets the scale factor applied to the view.<br />
1859 /// Animatable - This property can be animated using <c>Animation</c> class.
1861 /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
1864 /// The property cascade chaining set is not recommended.
1867 /// This way is recommended for setting the property
1869 /// var view = new View();
1870 /// view.Scale = new Vector3(1.5f, 2.0f, 1.0f);
1872 /// This way to set the property is prohibited
1874 /// view.Scale.Width = 1.5f; //This does not guarantee a proper operation
1877 /// <since_tizen> 3 </since_tizen>
1878 public Vector3 Scale
1882 return (Vector3)GetValue(ScaleProperty);
1886 SetValue(ScaleProperty, value);
1887 NotifyPropertyChanged();
1892 /// Gets or sets the scale X factor applied to the view.
1896 /// Animatable - This property can be animated using <c>Animation</c> class.
1898 /// animation.AnimateTo(view, "ScaleX", 1.5f);
1902 /// <since_tizen> 3 </since_tizen>
1907 return (float)GetValue(ScaleXProperty);
1911 SetValue(ScaleXProperty, value);
1912 NotifyPropertyChanged();
1917 /// Gets or sets the scale Y factor applied to the view.
1921 /// Animatable - This property can be animated using <c>Animation</c> class.
1923 /// animation.AnimateTo(view, "ScaleY", 1.5f);
1927 /// <since_tizen> 3 </since_tizen>
1932 return (float)GetValue(ScaleYProperty);
1936 SetValue(ScaleYProperty, value);
1937 NotifyPropertyChanged();
1942 /// Gets or sets the scale Z factor applied to the view.
1946 /// Animatable - This property can be animated using <c>Animation</c> class.
1948 /// animation.AnimateTo(view, "ScaleZ", 1.5f);
1952 /// <since_tizen> 3 </since_tizen>
1957 return (float)GetValue(ScaleZProperty);
1961 SetValue(ScaleZProperty, value);
1962 NotifyPropertyChanged();
1967 /// Gets the world scale of the view.
1969 /// <since_tizen> 3 </since_tizen>
1970 public Vector3 WorldScale
1974 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1975 var pValue = GetProperty(View.Property.WorldScale);
1983 /// Retrieves the visibility flag of the view.
1987 /// If the view is not visible, then the view and its children will not be rendered.
1988 /// 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.
1991 /// Animatable - This property can be animated using <c>Animation</c> class.
1993 /// animation.AnimateTo(view, "Visibility", false);
1997 /// <since_tizen> 3 </since_tizen>
1998 public bool Visibility
2003 var pValue = GetProperty(View.Property.VISIBLE);
2004 pValue.Get(out temp);
2011 /// Gets the view's world color.
2013 /// <since_tizen> 3 </since_tizen>
2014 public Vector4 WorldColor
2018 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
2019 var pValue = GetProperty(View.Property.WorldColor);
2027 /// Gets or sets the view's name.
2029 /// <since_tizen> 3 </since_tizen>
2034 return (string)GetValue(NameProperty);
2038 SetValue(NameProperty, value);
2039 NotifyPropertyChanged();
2044 /// Get the number of children held by the view.
2046 /// <since_tizen> 3 </since_tizen>
2047 public new uint ChildCount
2051 return Convert.ToUInt32(Children.Count);
2056 /// Gets the view's ID.
2059 /// <since_tizen> 3 </since_tizen>
2069 /// Gets or sets the status of whether the view should emit touch or hover signals.
2070 /// If a View is made insensitive, then the View and its children are not hittable.
2072 /// <since_tizen> 3 </since_tizen>
2073 public bool Sensitive
2077 return (bool)GetValue(SensitiveProperty);
2081 SetValue(SensitiveProperty, value);
2082 NotifyPropertyChanged();
2087 /// Gets or sets the status of whether the view should be enabled user interactions.
2088 /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled.
2090 /// <since_tizen> tizen_next </since_tizen>
2091 [EditorBrowsable(EditorBrowsableState.Never)]
2092 public bool IsEnabled
2096 return (bool)GetValue(IsEnabledProperty);
2100 SetValue(IsEnabledProperty, value);
2101 NotifyPropertyChanged();
2106 /// 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.
2108 /// <since_tizen> 3 </since_tizen>
2109 public bool LeaveRequired
2113 return (bool)GetValue(LeaveRequiredProperty);
2117 SetValue(LeaveRequiredProperty, value);
2118 NotifyPropertyChanged();
2123 /// Gets or sets the status of whether a child view inherits it's parent's orientation.
2125 /// <since_tizen> 3 </since_tizen>
2126 public bool InheritOrientation
2130 return (bool)GetValue(InheritOrientationProperty);
2134 SetValue(InheritOrientationProperty, value);
2135 NotifyPropertyChanged();
2140 /// Gets or sets the status of whether a child view inherits it's parent's scale.
2142 /// <since_tizen> 3 </since_tizen>
2143 public bool InheritScale
2147 return (bool)GetValue(InheritScaleProperty);
2151 SetValue(InheritScaleProperty, value);
2152 NotifyPropertyChanged();
2157 /// Gets or sets the status of how the view and its children should be drawn.<br />
2158 /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
2159 /// 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 />
2160 /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
2161 /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
2162 /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
2164 /// <since_tizen> 3 </since_tizen>
2165 public DrawModeType DrawMode
2169 return (DrawModeType)GetValue(DrawModeProperty);
2173 SetValue(DrawModeProperty, value);
2174 NotifyPropertyChanged();
2179 /// Gets or sets the relative to parent size factor of the view.<br />
2180 /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
2181 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
2184 /// The property cascade chaining set is not recommended.
2187 /// This way is recommended for setting the property
2189 /// var text = new TextField();
2190 /// text.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
2192 /// This way to set the property is prohibited
2194 /// text.SizeModeFactor.Width = 1.0f; //This does not guarantee a proper operation
2197 /// <since_tizen> 3 </since_tizen>
2198 public Vector3 SizeModeFactor
2202 return (Vector3)GetValue(SizeModeFactorProperty);
2206 SetValue(SizeModeFactorProperty, value);
2207 NotifyPropertyChanged();
2212 /// Gets or sets the width resize policy to be used.
2214 /// <since_tizen> 3 </since_tizen>
2215 public ResizePolicyType WidthResizePolicy
2219 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
2223 SetValue(WidthResizePolicyProperty, value);
2224 NotifyPropertyChanged();
2229 /// Gets or sets the height resize policy to be used.
2231 /// <since_tizen> 3 </since_tizen>
2232 public ResizePolicyType HeightResizePolicy
2236 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
2240 SetValue(HeightResizePolicyProperty, value);
2241 NotifyPropertyChanged();
2246 /// Gets or sets the policy to use when setting size with size negotiation.<br />
2247 /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
2249 /// <since_tizen> 3 </since_tizen>
2250 public SizeScalePolicyType SizeScalePolicy
2254 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
2258 SetValue(SizeScalePolicyProperty, value);
2259 NotifyPropertyChanged();
2264 /// Gets or sets the status of whether the width size is dependent on the height size.
2266 /// <since_tizen> 3 </since_tizen>
2267 public bool WidthForHeight
2271 return (bool)GetValue(WidthForHeightProperty);
2275 SetValue(WidthForHeightProperty, value);
2276 NotifyPropertyChanged();
2281 /// Gets or sets the status of whether the height size is dependent on the width size.
2283 /// <since_tizen> 3 </since_tizen>
2284 public bool HeightForWidth
2288 return (bool)GetValue(HeightForWidthProperty);
2292 SetValue(HeightForWidthProperty, value);
2293 NotifyPropertyChanged();
2298 /// Gets or sets the padding for use in layout.
2301 /// The property cascade chaining set is not recommended.
2304 /// This way is recommended for setting the property
2306 /// var view = new View();
2307 /// view.Padding = new Extents(5, 5, 5, 5);
2309 /// This way to set the property is prohibited
2311 /// view.Padding.Start = 5; //This does not guarantee a proper operation
2314 /// <since_tizen> 5 </since_tizen>
2315 public Extents Padding
2319 return (Extents)GetValue(PaddingProperty);
2323 SetValue(PaddingProperty, value);
2324 NotifyPropertyChanged();
2329 /// Gets or sets the minimum size the view can be assigned in size negotiation.
2331 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2333 /// The property cascade chaining set is not recommended.
2336 /// This way is recommended for setting the property
2338 /// var view = new View();
2339 /// view.MinimumSize = new Size2D(100, 200);
2341 /// This way to set the property is prohibited
2343 /// view.MinimumSize.Width = 100; //This does not guarantee a proper operation
2346 /// <since_tizen> 3 </since_tizen>
2347 public Size2D MinimumSize
2351 #if NUI_PROPERTY_CHANGE_DEBUG
2352 MinimumSizeGetter++;
2354 return (Size2D)GetValue(MinimumSizeProperty);
2358 #if NUI_PROPERTY_CHANGE_DEBUG
2359 MinimumSizeSetter++;
2363 throw new ArgumentNullException(nameof(value));
2367 // Note: it only works if minimum size is >= than natural size.
2368 // To force the size it should be done through the width&height spec or Size2D.
2369 layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
2370 layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
2371 layout.RequestLayout();
2373 SetValue(MinimumSizeProperty, value);
2374 NotifyPropertyChanged();
2379 /// Gets or sets the maximum size the view can be assigned in size negotiation.
2382 /// This way is recommended for setting the property
2384 /// var view = new View();
2385 /// view.MaximumSize = new Size2D(100, 200);
2387 /// This way to set the property is prohibited
2389 /// view.MaximumSize.Height = 200; //This does not guarantee a proper operation
2392 /// <since_tizen> 3 </since_tizen>
2393 public Size2D MaximumSize
2397 #if NUI_PROPERTY_CHANGE_DEBUG
2398 MaximumSizeGetter++;
2400 return (Size2D)GetValue(MaximumSizeProperty);
2404 #if NUI_PROPERTY_CHANGE_DEBUG
2405 MaximumSizeSetter++;
2407 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
2408 // MATCH_PARENT spec + parent container size can be used to limit
2411 layout.RequestLayout();
2413 SetValue(MaximumSizeProperty, value);
2414 NotifyPropertyChanged();
2419 /// Gets or sets whether a child view inherits it's parent's position.<br />
2420 /// Default is to inherit.<br />
2421 /// 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 />
2423 /// <since_tizen> 3 </since_tizen>
2424 public bool InheritPosition
2428 return (bool)GetValue(InheritPositionProperty);
2432 SetValue(InheritPositionProperty, value);
2433 NotifyPropertyChanged();
2438 /// Gets or sets the clipping behavior (mode) of it's children.
2440 /// <since_tizen> 3 </since_tizen>
2441 public ClippingModeType ClippingMode
2445 return (ClippingModeType)GetValue(ClippingModeProperty);
2449 SetValue(ClippingModeProperty, value);
2450 NotifyPropertyChanged();
2455 /// Gets the number of renderers held by the view.
2457 /// <since_tizen> 3 </since_tizen>
2458 public uint RendererCount
2462 return GetRendererCount();
2467 /// This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead.
2470 /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2472 /// <since_tizen> 3 </since_tizen>
2473 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead. " +
2475 "View view = new View(); " +
2476 "view.PivotPoint = PivotPoint.Center; " +
2477 "view.PositionUsesPivotPoint = true;")]
2478 [EditorBrowsable(EditorBrowsableState.Never)]
2479 public Position AnchorPoint
2483 return GetValue(AnchorPointProperty) as Position;
2487 SetValue(AnchorPointProperty, value);
2491 private Position InternalAnchorPoint
2495 Position temp = new Position(0.0f, 0.0f, 0.0f);
2496 var pValue = GetProperty(View.Property.AnchorPoint);
2499 Position ret = new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
2505 var temp = new Tizen.NUI.PropertyValue(value);
2506 SetProperty(View.Property.AnchorPoint, temp);
2508 NotifyPropertyChanged();
2513 /// Sets the size of a view for the width, the height and the depth.<br />
2514 /// Geometry can be scaled to fit within this area.<br />
2515 /// This does not interfere with the view's scale factor.<br />
2516 /// The views default depth is the minimum of width and height.<br />
2520 /// Animatable - This property can be animated using <c>Animation</c> class.
2522 /// animation.AnimateTo(view, "Size", new Size(100, 100));
2525 /// The property cascade chaining set is not recommended.
2528 /// This way is recommended for setting the property
2530 /// var view = new View();
2531 /// view.Size = new Size(100.5f, 200, 0);
2533 /// This way to set the property is prohibited
2535 /// view.Size.Width = 100.5f; //This does not guarantee a proper operation
2538 /// <since_tizen> 5 </since_tizen>
2543 #if NUI_PROPERTY_CHANGE_DEBUG
2546 return (Size)GetValue(SizeProperty);
2550 #if NUI_PROPERTY_CHANGE_DEBUG
2553 SetValue(SizeProperty, value);
2554 NotifyPropertyChanged();
2559 /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead.
2561 /// <since_tizen> 3 </since_tizen>
2562 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. " +
2564 "Container parent = view.GetParent(); " +
2565 "View view = parent as View;")]
2566 [EditorBrowsable(EditorBrowsableState.Never)]
2567 public new View Parent
2572 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2573 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2574 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2576 if (basehandle is Layer layer)
2578 ret = new View(Layer.getCPtr(layer).Handle, false);
2579 NUILog.Error("This Parent property is deprecated, should do not be used");
2583 ret = basehandle as View;
2586 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2587 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2589 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2595 /// Gets/Sets whether inherit parent's the layout Direction.
2597 /// <since_tizen> 4 </since_tizen>
2598 public bool InheritLayoutDirection
2602 return (bool)GetValue(InheritLayoutDirectionProperty);
2606 SetValue(InheritLayoutDirectionProperty, value);
2607 NotifyPropertyChanged();
2612 /// Gets/Sets the layout Direction.
2614 /// <since_tizen> 4 </since_tizen>
2615 public ViewLayoutDirectionType LayoutDirection
2619 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2623 SetValue(LayoutDirectionProperty, value);
2624 NotifyPropertyChanged();
2625 layout?.RequestLayout();
2630 /// Gets or sets the Margin for use in layout.
2633 /// Margin property is supported by Layout algorithms and containers.
2634 /// Please Set Layout if you want to use Margin property.
2635 /// The property cascade chaining set is not recommended.
2638 /// This way is recommended for setting the property
2640 /// var view = new View();
2641 /// view.Margin = new Extents(10, 5, 15, 20);
2643 /// This way to set the property is prohibited
2645 /// view.Margin.Top = 15; //This does not guarantee a proper operation
2648 /// <since_tizen> 4 </since_tizen>
2649 public Extents Margin
2653 return (Extents)GetValue(MarginProperty);
2657 SetValue(MarginProperty, value);
2658 NotifyPropertyChanged();
2663 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2667 /// // matchParentView matches its size to its parent size.
2668 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2669 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2671 /// // wrapContentView wraps its children with their desired size.
2672 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2673 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2675 /// // exactSizeView shows itself with an exact size.
2676 /// exactSizeView.WidthSpecification = 100;
2677 /// exactSizeView.HeightSpecification = 100;
2680 /// <since_tizen> 6 </since_tizen>
2681 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2682 public int WidthSpecification
2686 return (int)GetValue(WidthSpecificationProperty);
2690 SetValue(WidthSpecificationProperty, value);
2691 NotifyPropertyChanged();
2695 private int InternalWidthSpecification
2703 if (value == widthPolicy)
2706 widthPolicy = value;
2707 if (widthPolicy >= 0)
2709 if (heightPolicy >= 0) // Policy an exact value
2711 // Create Size2D only both _widthPolicy and _heightPolicy are set.
2712 Size2D = new Size2D(widthPolicy, heightPolicy);
2715 layout?.RequestLayout();
2720 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2724 /// // matchParentView matches its size to its parent size.
2725 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2726 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2728 /// // wrapContentView wraps its children with their desired size.
2729 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2730 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2732 /// // exactSizeView shows itself with an exact size.
2733 /// exactSizeView.WidthSpecification = 100;
2734 /// exactSizeView.HeightSpecification = 100;
2737 /// <since_tizen> 6 </since_tizen>
2738 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2739 public int HeightSpecification
2743 return (int)GetValue(HeightSpecificationProperty);
2747 SetValue(HeightSpecificationProperty, value);
2748 NotifyPropertyChanged();
2752 private int InternalHeightSpecification
2756 return heightPolicy;
2760 if (value == heightPolicy)
2763 heightPolicy = value;
2764 if (heightPolicy >= 0)
2766 if (widthPolicy >= 0) // Policy an exact value
2768 // Create Size2D only both _widthPolicy and _heightPolicy are set.
2769 Size2D = new Size2D(widthPolicy, heightPolicy);
2772 layout?.RequestLayout();
2777 /// Gets the List of transitions for this View.
2779 /// <since_tizen> 6 </since_tizen>
2780 public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2784 if (layoutTransitions == null)
2786 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2788 return layoutTransitions;
2793 /// Sets a layout transitions for this View.
2795 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2797 /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2799 /// <since_tizen> 6 </since_tizen>
2800 public LayoutTransition LayoutTransition
2804 return GetValue(LayoutTransitionProperty) as LayoutTransition;
2808 SetValue(LayoutTransitionProperty, value);
2809 NotifyPropertyChanged();
2813 private LayoutTransition InternalLayoutTransition
2817 return layoutTransition;
2823 throw new global::System.ArgumentNullException(nameof(value));
2825 if (layoutTransitions == null)
2827 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2830 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
2832 AttachTransitionsToChildren(value);
2834 layoutTransition = value;
2839 /// This has been deprecated in API5 and will be removed in API8. Use Padding instead.
2842 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2844 /// <since_tizen> 4 </since_tizen>
2845 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use Padding instead.")]
2846 [EditorBrowsable(EditorBrowsableState.Never)]
2847 public Extents PaddingEX
2851 return GetValue(PaddingEXProperty) as Extents;
2855 SetValue(PaddingEXProperty, value);
2859 private Extents InternalPaddingEX
2863 Extents temp = new Extents(0, 0, 0, 0);
2864 var pValue = GetProperty(View.Property.PADDING);
2867 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2873 var temp = new Tizen.NUI.PropertyValue(value);
2874 SetProperty(View.Property.PADDING, temp);
2876 NotifyPropertyChanged();
2877 layout?.RequestLayout();
2882 /// The Color of View. This is an RGBA value.
2883 /// Each RGBA components match as <see cref="ColorRed"/>, <see cref="ColorGreen"/>, <see cref="ColorBlue"/>, and <see cref="Opacity"/>.
2884 /// This property will multiply the final color of this view. (BackgroundColor, BorderlineColor, BackgroundImage, etc).
2885 /// For example, if view.BackgroundColor = Color.Yellow and view.Color = Color.Purple, this view will shown as Red.
2886 /// Inherient of color value depend on <see cref="ColorMode"/>.
2890 /// Animatable - This property can be animated using <c>Animation</c> class.
2892 /// The property cascade chaining set is not recommended.
2895 /// This way is recommended for setting the property
2897 /// var view = new View();
2898 /// view.Color = new Color(0.5f, 0.2f, 0.1f, 0.5f);
2900 /// This way to set the property is prohibited
2902 /// view.Color.A = 0.5f; //This does not guarantee a proper operation
2905 [EditorBrowsable(EditorBrowsableState.Never)]
2910 return (Color)GetValue(ColorProperty);
2914 SetValue(ColorProperty, value);
2915 NotifyPropertyChanged();
2920 /// The Red component of View.Color.
2924 /// Animatable - This property can be animated using <c>Animation</c> class.
2927 [EditorBrowsable(EditorBrowsableState.Never)]
2928 public float ColorRed
2932 return (float)GetValue(ColorRedProperty);
2936 SetValue(ColorRedProperty, value);
2937 NotifyPropertyChanged();
2942 /// The Green component of View.Color.
2946 /// Animatable - This property can be animated using <c>Animation</c> class.
2949 [EditorBrowsable(EditorBrowsableState.Never)]
2950 public float ColorGreen
2954 return (float)GetValue(ColorGreenProperty);
2958 SetValue(ColorGreenProperty, value);
2959 NotifyPropertyChanged();
2964 /// The Blue component of View.Color.
2968 /// Animatable - This property can be animated using <c>Animation</c> class.
2971 [EditorBrowsable(EditorBrowsableState.Never)]
2972 public float ColorBlue
2976 return (float)GetValue(ColorBlueProperty);
2980 SetValue(ColorBlueProperty, value);
2981 NotifyPropertyChanged();
2986 /// Set the layout on this View. Replaces any existing Layout.
2989 /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
2991 /// <since_tizen> 6 </since_tizen>
2992 public LayoutItem Layout
2996 return GetValue(LayoutProperty) as LayoutItem;
3000 SetValue(LayoutProperty, value);
3004 private LayoutItem InternalLayout
3012 // Do nothing if layout provided is already set on this View.
3013 if (value == layout)
3018 LayoutingDisabled = false;
3021 // If new layout being set already has a owner then that owner receives a replacement default layout.
3022 // First check if the layout to be set already has a owner.
3023 if (value?.Owner != null)
3025 // Previous owner of the layout gets a default layout as a replacement.
3026 value.Owner.Layout = new AbsoluteLayout()
3028 // Copy Margin and Padding to replacement LayoutGroup.
3029 Margin = value.Margin,
3030 Padding = value.Padding,
3034 // Copy Margin and Padding to new layout being set or restore padding and margin back to
3035 // View if no replacement. Previously margin and padding values would have been moved from
3036 // the View to the layout.
3037 if (layout != null) // Existing layout
3041 // Existing layout being replaced so copy over margin and padding values.
3042 value.Margin = layout.Margin;
3043 value.Padding = layout.Padding;
3044 value.SetPositionByLayout = !excludeLayouting;
3048 // Layout not being replaced so restore margin and padding to View.
3049 SetValue(MarginProperty, layout.Margin);
3050 SetValue(PaddingProperty, layout.Padding);
3051 NotifyPropertyChanged();
3056 // First Layout to be added to the View hence copy
3058 // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
3061 Extents margin = Margin;
3062 Extents padding = Padding;
3063 bool setMargin = false;
3064 bool setPadding = false;
3066 if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
3068 // If View already has a margin set then store it in Layout instead.
3069 value.Margin = margin;
3070 SetValue(MarginProperty, new Extents(0, 0, 0, 0));
3074 if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
3076 // If View already has a padding set then store it in Layout instead.
3077 value.Padding = padding;
3078 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
3082 if (setMargin || setPadding)
3084 NotifyPropertyChanged();
3087 value.SetPositionByLayout = !excludeLayouting;
3091 // Remove existing layout from it's parent layout group.
3094 // Set layout to this view
3100 /// The weight of the View, used to share available space in a layout with siblings.
3102 /// <since_tizen> 6 </since_tizen>
3112 layout?.RequestLayout();
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_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
3122 [EditorBrowsable(EditorBrowsableState.Never)]
3123 public bool BackgroundImageSynchronosLoading
3127 return (bool)GetValue(BackgroundImageSynchronosLoadingProperty);
3131 SetValue(BackgroundImageSynchronosLoadingProperty, value);
3132 NotifyPropertyChanged();
3136 private bool InternalBackgroundImageSynchronosLoading
3140 return BackgroundImageSynchronousLoading;
3144 BackgroundImageSynchronousLoading = value;
3149 /// Whether to load the BackgroundImage synchronously.
3150 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3151 /// Note: For Normal Quad images only.
3153 /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3154 [EditorBrowsable(EditorBrowsableState.Never)]
3155 public bool BackgroundImageSynchronousLoading
3159 return (bool)GetValue(BackgroundImageSynchronousLoadingProperty);
3163 SetValue(BackgroundImageSynchronousLoadingProperty, value);
3164 NotifyPropertyChanged();
3168 private bool InternalBackgroundImageSynchronousLoading
3172 return backgroundImageSynchronousLoading;
3176 backgroundImageSynchronousLoading = value;
3178 string bgUrl = null;
3179 var pValue = Background.Find(ImageVisualProperty.URL);
3180 pValue?.Get(out bgUrl);
3183 if (!string.IsNullOrEmpty(bgUrl))
3185 PropertyMap bgMap = this.Background;
3186 var temp = new PropertyValue(backgroundImageSynchronousLoading);
3187 bgMap[ImageVisualProperty.SynchronousLoading] = temp;
3194 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3195 [EditorBrowsable(EditorBrowsableState.Never)]
3196 public Vector4 UpdateAreaHint
3200 return (Vector4)GetValue(UpdateAreaHintProperty);
3204 SetValue(UpdateAreaHintProperty, value);
3205 NotifyPropertyChanged();
3210 /// Enable/Disable ControlState propagation for children.
3211 /// It is false by default.
3212 /// If the View needs to share ControlState with descendants, please set it true.
3213 /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
3215 [EditorBrowsable(EditorBrowsableState.Never)]
3216 public bool EnableControlStatePropagation
3220 return (bool)GetValue(EnableControlStatePropagationProperty);
3224 SetValue(EnableControlStatePropagationProperty, value);
3225 NotifyPropertyChanged();
3229 private bool InternalEnableControlStatePropagation
3231 get => themeData?.ControlStatePropagation ?? false;
3234 if (InternalEnableControlStatePropagation == value) return;
3236 if (themeData == null) themeData = new ThemeData();
3238 themeData.ControlStatePropagation = value;
3240 foreach (View child in Children)
3242 child.EnableControlStatePropagation = value;
3248 /// The ControlStates can propagate from the parent.
3249 /// Listed ControlStates will be accepted propagation of the parent ControlState changes
3250 /// if parent view EnableControlState is true.
3251 /// <see cref="EnableControlState"/>.
3252 /// Default is ControlState.All, so every ControlStates will be propagated from the parent.
3254 [EditorBrowsable(EditorBrowsableState.Never)]
3255 public ControlState PropagatableControlStates
3259 return (ControlState)GetValue(PropagatableControlStatesProperty);
3263 SetValue(PropagatableControlStatesProperty, value);
3264 NotifyPropertyChanged();
3268 private ControlState InternalPropagatableControlStates
3270 get => propagatableControlStates;
3271 set => propagatableControlStates = value;
3275 /// By default, it is false in View, true in Control.
3276 /// Note that if the value is true, the View will be a touch receptor.
3278 [EditorBrowsable(EditorBrowsableState.Never)]
3279 public bool EnableControlState
3283 return (bool)GetValue(EnableControlStateProperty);
3287 SetValue(EnableControlStateProperty, value);
3292 /// Whether the actor grab all touches even if touch leaves its boundary.
3294 /// <returns>true, if it grab all touch after start</returns>
3295 [EditorBrowsable(EditorBrowsableState.Never)]
3296 public bool GrabTouchAfterLeave
3300 return (bool)GetValue(GrabTouchAfterLeaveProperty);
3304 SetValue(GrabTouchAfterLeaveProperty, value);
3308 private bool InternalGrabTouchAfterLeave
3313 var pValue = GetProperty(View.Property.CaptureAllTouchAfterStart);
3314 pValue.Get(out temp);
3320 var temp = new Tizen.NUI.PropertyValue(value);
3321 SetProperty(View.Property.CaptureAllTouchAfterStart, temp);
3323 NotifyPropertyChanged();
3328 /// Whether the view will only receive own touch.
3330 /// <returns>true, if it only receives touches that started from itself.</returns>
3331 [EditorBrowsable(EditorBrowsableState.Never)]
3332 public bool AllowOnlyOwnTouch
3336 return (bool)GetValue(AllowOnlyOwnTouchProperty);
3340 SetValue(AllowOnlyOwnTouchProperty, value);
3344 private bool InternalAllowOnlyOwnTouch
3349 var pValue = GetProperty(View.Property.AllowOnlyOwnTouch);
3350 pValue.Get(out temp);
3356 var temp = new Tizen.NUI.PropertyValue(value);
3357 SetProperty(View.Property.AllowOnlyOwnTouch, temp);
3359 NotifyPropertyChanged();
3364 /// Determines which blend equation will be used to render renderers of this actor.
3366 /// <returns>blend equation enum currently assigned</returns>
3367 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
3368 [EditorBrowsable(EditorBrowsableState.Never)]
3369 public BlendEquationType BlendEquation
3373 return (BlendEquationType)GetValue(BlendEquationProperty);
3377 SetValue(BlendEquationProperty, value);
3381 private BlendEquationType InternalBlendEquation
3386 var pValue = GetProperty(View.Property.BlendEquation);
3387 pValue.Get(out temp);
3389 return (BlendEquationType)temp;
3393 var temp = new Tizen.NUI.PropertyValue((int)value);
3394 SetProperty(View.Property.BlendEquation, temp);
3396 NotifyPropertyChanged();
3401 /// If the value is true, the View will change its style as the theme changes.
3402 /// The default value is false in normal case but it can be true when the NUIApplication is created with <see cref="NUIApplication.ThemeOptions.ThemeChangeSensitive"/>.
3404 /// <since_tizen> 9 </since_tizen>
3405 public bool ThemeChangeSensitive
3407 get => (bool)GetValue(ThemeChangeSensitiveProperty);
3408 set => SetValue(ThemeChangeSensitiveProperty, value);
3412 /// Create Style, it is abstract function and must be override.
3414 [EditorBrowsable(EditorBrowsableState.Never)]
3415 protected virtual ViewStyle CreateViewStyle()
3417 return new ViewStyle();
3421 /// Called after the View's ControlStates changed.
3423 /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
3424 [EditorBrowsable(EditorBrowsableState.Never)]
3425 protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
3431 [EditorBrowsable(EditorBrowsableState.Never)]
3432 protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
3434 isThemeChanged = true;
3435 if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
3436 else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
3437 isThemeChanged = false;
3441 /// Apply style instance to the view.
3442 /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
3444 /// <since_tizen> 9 </since_tizen>
3445 public virtual void ApplyStyle(ViewStyle viewStyle)
3447 if (viewStyle == null || themeData?.viewStyle == viewStyle) return;
3449 if (themeData == null) themeData = new ThemeData();
3451 themeData.viewStyle = viewStyle;
3453 if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
3459 BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
3461 if (bindablePropertyOfView == null)
3466 var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
3467 viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
3469 foreach (var sourceProperty in dirtyStyleProperties)
3471 var sourceValue = viewStyle.GetValue(sourceProperty);
3473 if (sourceValue == null)
3478 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
3480 // Do not set value again when theme is changed and the value has been set already.
3481 if (isThemeChanged && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty))
3486 if (destinationProperty != null)
3488 InternalSetValue(destinationProperty, sourceValue);
3494 /// Get whether the View is culled or not.
3495 /// True means that the View is out of the view frustum.
3498 /// Hidden-API (Inhouse-API).
3500 [EditorBrowsable(EditorBrowsableState.Never)]
3506 var pValue = GetProperty(View.Property.Culled);
3507 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 it's children will not emit a key event signal either.
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 /// Called when the view is hit through TouchEvent or GestureEvent.
3600 /// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
3601 /// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
3602 /// User can override whether hit or not in HitTest.
3603 /// You can get the coordinates relative to tthe top-left of the hit view by touch.GetLocalPosition(0).
3604 /// or you can get the coordinates relative to the top-left of the screen by touch.GetScreenPosition(0).
3606 // <param name="touch"><see cref="Tizen.NUI.Touch"/>The touch data</param>
3607 [EditorBrowsable(EditorBrowsableState.Never)]
3608 protected virtual bool HitTest(Touch touch)
3614 /// Retrieve the View's current Color.
3617 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3618 /// 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).
3619 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3620 /// and users can get the current actual values through them.
3622 [EditorBrowsable(EditorBrowsableState.Never)]
3623 public Color CurrentColor => GetCurrentColor();
3626 /// Retrieve the current scale factor applied to the View.
3629 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3630 /// 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).
3631 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3632 /// and users can get the current actual values through them.
3634 [EditorBrowsable(EditorBrowsableState.Never)]
3635 public Vector3 CurrentScale => GetCurrentScale();