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;
78 RegisterPropertyGroup(PositionProperty, positionPropertyGroup);
79 RegisterPropertyGroup(Position2DProperty, positionPropertyGroup);
80 RegisterPropertyGroup(PositionXProperty, positionPropertyGroup);
81 RegisterPropertyGroup(PositionYProperty, positionPropertyGroup);
83 RegisterPropertyGroup(SizeProperty, sizePropertyGroup);
84 RegisterPropertyGroup(Size2DProperty, sizePropertyGroup);
85 RegisterPropertyGroup(SizeWidthProperty, sizePropertyGroup);
86 RegisterPropertyGroup(SizeHeightProperty, sizePropertyGroup);
88 RegisterPropertyGroup(ScaleProperty, scalePropertyGroup);
89 RegisterPropertyGroup(ScaleXProperty, scalePropertyGroup);
90 RegisterPropertyGroup(ScaleYProperty, scalePropertyGroup);
91 RegisterPropertyGroup(ScaleZProperty, scalePropertyGroup);
93 RegisterAccessibilityDelegate();
97 /// Creates a new instance of a view.
99 /// <since_tizen> 3 </since_tizen>
100 public View() : this(Interop.View.New(), true)
102 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
105 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
106 [EditorBrowsable(EditorBrowsableState.Never)]
107 public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
112 /// Create a new instance of a View with setting the status of shown or hidden.
114 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
115 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
116 [EditorBrowsable(EditorBrowsableState.Never)]
117 public View(bool shown) : this(Interop.View.New(), true)
119 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
123 internal View(View uiControl, bool shown = true) : this(Interop.View.NewView(View.getCPtr(uiControl)), true)
125 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
131 backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
134 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
136 InitializeStyle(viewStyle);
139 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn)
143 PositionUsesPivotPoint = false;
146 onWindowSendEventCallback = SendViewAddedEventToWindow;
147 using ViewSignal signal = new ViewSignal(Interop.ActorSignal.ActorOnSceneSignal(SwigCPtr), false);
148 signal?.Connect(onWindowSendEventCallback);
150 hitTestResultDataCallback = OnHitTestResult;
151 using TouchDataSignal touchDataSignal = new TouchDataSignal(Interop.ActorSignal.ActorHitTestResultSignal(SwigCPtr), false);
152 touchDataSignal?.Connect(hitTestResultDataCallback);
159 GrabTouchAfterLeave = defaultGrabTouchAfterLeave;
160 AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch;
163 internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
165 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
174 /// The event that is triggered when the View's ControlState is changed.
176 [EditorBrowsable(EditorBrowsableState.Never)]
177 public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
179 internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
183 /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
185 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
186 [EditorBrowsable(EditorBrowsableState.Never)]
187 public bool LayoutSet
196 /// Flag to allow Layouting to be disabled for Views.
197 /// Once a View has a Layout set then any children added to Views from then on will receive
198 /// automatic Layouts.
200 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
201 [EditorBrowsable(EditorBrowsableState.Never)]
202 public static bool LayoutingDisabled { get; set; } = true;
205 /// If set to true, the <see cref="GrabTouchAfterLeave"/> property value is set to true when all Views are created.
207 /// <param name="enable">Sets value of GrabTouchAfterLeave property</param>
208 [EditorBrowsable(EditorBrowsableState.Never)]
209 public static void SetDefaultGrabTouchAfterLeave(bool enable)
211 defaultGrabTouchAfterLeave = enable;
215 /// If set to true, the <see cref="AllowOnlyOwnTouch"/> property value is set to true when all Views are created.
217 /// <param name="enable">Sets value of AllowOnlyOwnTouch property</param>
218 [EditorBrowsable(EditorBrowsableState.Never)]
219 public static void SetDefaultAllowOnlyOwnTouch(bool enable)
221 defaultAllowOnlyOwnTouch = enable;
225 /// Deprecate. Do not use this.
226 /// The style instance applied to this view.
227 /// Note that do not modify the ViewStyle.
228 /// Modifying ViewStyle will affect other views with same ViewStyle.
230 [EditorBrowsable(EditorBrowsableState.Never)]
231 protected ViewStyle ViewStyle
235 if (themeData == null) themeData = new ThemeData();
237 if (themeData.viewStyle == null)
239 ApplyStyle(CreateViewStyle());
241 return themeData.viewStyle;
246 /// Get/Set the control state.
247 /// Note that the ControlState only available for the classes derived from Control.
248 /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
249 /// please set <see cref="EnableControlState"/> to true.
251 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
252 [EditorBrowsable(EditorBrowsableState.Never)]
253 public ControlState ControlState
257 return themeData == null ? ControlState.Normal : themeData.controlStates;
261 if (ControlState == value)
266 var prevState = ControlState;
268 if (themeData == null) themeData = new ThemeData();
269 themeData.controlStates = value;
271 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
273 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
275 if (themeData.ControlStatePropagation)
277 foreach (View child in Children)
279 ControlState allowed = child.PropagatableControlStates;
280 if (allowed.Contains(ControlState.All))
282 child.ControlState = value;
286 ControlState newControlState = child.ControlState;
288 if (allowed.Contains(ControlState.Normal))
290 if (value.Contains(ControlState.Normal))
292 newControlState += ControlState.Normal;
296 newControlState -= ControlState.Normal;
300 if (allowed.Contains(ControlState.Disabled))
302 if (value.Contains(ControlState.Disabled))
304 newControlState += ControlState.Disabled;
308 newControlState -= ControlState.Disabled;
312 if (allowed.Contains(ControlState.Selected))
314 if (value.Contains(ControlState.Selected))
316 newControlState += ControlState.Selected;
320 newControlState -= ControlState.Selected;
324 if (allowed.Contains(ControlState.Pressed))
326 if (value.Contains(ControlState.Pressed))
328 newControlState += ControlState.Pressed;
332 newControlState -= ControlState.Pressed;
336 if (allowed.Contains(ControlState.Focused))
338 if (value.Contains(ControlState.Focused))
340 newControlState += ControlState.Focused;
344 newControlState -= ControlState.Focused;
348 if (allowed.Contains(ControlState.Other))
350 if (value.Contains(ControlState.Other))
352 newControlState += ControlState.Other;
356 newControlState -= ControlState.Other;
360 if (child.ControlState != newControlState)
361 child.ControlState = newControlState;
366 OnControlStateChanged(changeInfo);
368 ControlStateChangedEvent?.Invoke(this, changeInfo);
373 /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
375 /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
376 [EditorBrowsable(EditorBrowsableState.Never)]
377 public bool ExcludeLayouting
381 return (bool)GetValue(ExcludeLayoutingProperty);
385 SetValue(ExcludeLayoutingProperty, value);
386 NotifyPropertyChanged();
390 private bool InternalExcludeLayouting
394 return excludeLayouting;
398 excludeLayouting = value;
399 if (Layout != null && Layout.SetPositionByLayout == value)
401 Layout.SetPositionByLayout = !value;
402 Layout.RequestLayout();
408 /// The StyleName, type string.
409 /// The value indicates DALi style name defined in json theme file.
411 /// <since_tizen> 3 </since_tizen>
412 public string StyleName
416 return (string)GetValue(StyleNameProperty);
420 SetValue(StyleNameProperty, value);
421 NotifyPropertyChanged();
426 /// The KeyInputFocus, type bool.
428 [EditorBrowsable(EditorBrowsableState.Never)]
429 public bool KeyInputFocus
433 return (bool)GetValue(KeyInputFocusProperty);
437 SetValue(KeyInputFocusProperty, value);
438 NotifyPropertyChanged();
443 /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
447 /// The property cascade chaining set is not recommended.
450 /// Animatable - This property can be animated using <c>Animation</c> class.
452 /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
457 /// This way is recommended for setting the property
459 /// var view = new View();
460 /// view.BackgroundColor = new Color(0.5f, 0.1f, 0, 1);
462 /// This way to set the property is prohibited
464 /// view.BackgroundColor.R = 0.5f; //This does not guarantee a proper operation
467 /// <since_tizen> 3 </since_tizen>
468 public Color BackgroundColor
472 return (Color)GetValue(BackgroundColorProperty);
476 SetValue(BackgroundColorProperty, value);
477 NotifyPropertyChanged();
482 /// The mutually exclusive with "backgroundColor" and "background" type Map.
484 /// <since_tizen> 3 </since_tizen>
485 public string BackgroundImage
489 return (string)GetValue(BackgroundImageProperty);
493 SetValue(BackgroundImageProperty, value);
494 NotifyPropertyChanged();
499 /// Get or set the border of background image.
501 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
502 [EditorBrowsable(EditorBrowsableState.Never)]
503 public Rectangle BackgroundImageBorder
507 return (Rectangle)GetValue(BackgroundImageBorderProperty);
511 SetValue(BackgroundImageBorderProperty, value);
512 NotifyPropertyChanged();
517 /// The background of view.
519 /// <since_tizen> 3 </since_tizen>
520 public Tizen.NUI.PropertyMap Background
524 return (PropertyMap)GetValue(BackgroundProperty);
528 SetValue(BackgroundProperty, value);
529 NotifyPropertyChanged();
534 /// Describes a shadow as an image for a View.
535 /// It is null by default.
538 /// Getter returns copied instance of current shadow.
541 /// The mutually exclusive with "BoxShadow".
545 /// Animatable - This property can be animated using <c>Animation</c> class.
546 /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
548 /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
550 /// Animatable sub-property : Offset.
553 [EditorBrowsable(EditorBrowsableState.Never)]
554 public ImageShadow ImageShadow
558 return (ImageShadow)GetValue(ImageShadowProperty);
562 SetValue(ImageShadowProperty, value);
563 NotifyPropertyChanged();
568 /// Describes a box shaped shadow drawing for a View.
569 /// It is null by default.
572 /// The mutually exclusive with "ImageShadow".
576 /// Animatable - This property can be animated using <c>Animation</c> class.
577 /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
579 /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
581 /// Animatable sub-property : Offset, Color, BlurRadius.
584 /// <since_tizen> 9 </since_tizen>
585 public Shadow BoxShadow
589 return (Shadow)GetValue(BoxShadowProperty);
593 SetValue(BoxShadowProperty, value);
594 NotifyPropertyChanged();
599 /// The radius for the rounded corners of the View.
600 /// This will rounds background and shadow edges.
601 /// 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).
602 /// Each radius will clamp internally to the half of smaller of the view's width or height.
603 /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
607 /// Animatable - This property can be animated using <c>Animation</c> class.
609 /// animation.AnimateTo(view, "CornerRadius", new Vector4(10, 10, 10, 10));
613 /// <since_tizen> 9 </since_tizen>
614 public Vector4 CornerRadius
618 return (Vector4)GetValue(CornerRadiusProperty);
622 SetValue(CornerRadiusProperty, value);
623 NotifyPropertyChanged();
628 /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
629 /// It is absolute by default.
630 /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
632 /// <since_tizen> 9 </since_tizen>
633 public VisualTransformPolicyType CornerRadiusPolicy
635 get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
636 set => SetValue(CornerRadiusPolicyProperty, value);
640 /// The width for the borderline of the View.
644 /// Animatable - This property can be animated using <c>Animation</c> class.
646 /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
649 /// Note that, an image background may not have borderline if it uses the Border property.
651 /// <since_tizen> 9 </since_tizen>
652 public float BorderlineWidth
656 return (float)GetValue(BorderlineWidthProperty);
660 SetValue(BorderlineWidthProperty, value);
661 NotifyPropertyChanged();
666 /// The color for the borderline of the View.
667 /// It is Color.Black by default.
671 /// Animatable - This property can be animated using <c>Animation</c> class.
673 /// animation.AnimateTo(view, "BorderlineColor", new Color(r, g, b, a));
677 /// <since_tizen> 9 </since_tizen>
678 public Color BorderlineColor
682 return (Color)GetValue(BorderlineColorProperty);
686 SetValue(BorderlineColorProperty, value);
687 NotifyPropertyChanged();
692 /// The Relative offset for the borderline of the View.
693 /// Recommended range : [-1.0f to 1.0f].
694 /// If -1.0f, draw borderline inside of the View.
695 /// If 1.0f, draw borderline outside of the View.
696 /// If 0.0f, draw borderline half inside and half outside.
697 /// It is 0.0f by default.
701 /// Animatable - This property can be animated using <c>Animation</c> class.
703 /// animation.AnimateTo(view, "BorderlineOffset", -1.0f);
707 /// <since_tizen> 9 </since_tizen>
708 public float BorderlineOffset
712 return (float)GetValue(BorderlineOffsetProperty);
716 SetValue(BorderlineOffsetProperty, value);
717 NotifyPropertyChanged();
722 /// The current state of the view.
724 /// <since_tizen> 3 </since_tizen>
729 return (States)GetValue(StateProperty);
733 SetValue(StateProperty, value);
734 NotifyPropertyChanged();
739 /// The current sub state of the view.
741 /// <since_tizen> 3 </since_tizen>
742 public States SubState
746 return (States)GetValue(SubStateProperty);
750 SetValue(SubStateProperty, value);
751 NotifyPropertyChanged();
756 /// Displays a tooltip
758 /// <since_tizen> 3 </since_tizen>
759 public Tizen.NUI.PropertyMap Tooltip
763 return (PropertyMap)GetValue(TooltipProperty);
767 SetValue(TooltipProperty, value);
768 NotifyPropertyChanged();
773 /// Displays a tooltip as a text.
775 /// <since_tizen> 3 </since_tizen>
776 public string TooltipText
780 return GetValue(TooltipTextProperty) as string;
784 SetValue(TooltipTextProperty, value);
788 private string InternalTooltipText
792 using (var propertyValue = GetProperty(Property.TOOLTIP))
794 if (propertyValue != null && propertyValue.Get(out string retrivedValue))
796 return retrivedValue;
798 NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
799 return "error to get TooltipText";
804 var temp = new Tizen.NUI.PropertyValue(value);
805 SetProperty(View.Property.TOOLTIP, temp);
807 NotifyPropertyChanged();
812 /// The Child property of FlexContainer.<br />
813 /// The proportion of the free space in the container, the flex item will receive.<br />
814 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
816 /// <since_tizen> 3 </since_tizen>
817 [Obsolete("Deprecated in API8, will be removed in API10.")]
822 return (float)GetValue(FlexProperty);
826 SetValue(FlexProperty, value);
827 NotifyPropertyChanged();
832 /// The Child property of FlexContainer.<br />
833 /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
835 /// <since_tizen> 3 </since_tizen>
836 [Obsolete("Deprecated in API8, will be removed in API10.")]
841 return (int)GetValue(AlignSelfProperty);
845 SetValue(AlignSelfProperty, value);
846 NotifyPropertyChanged();
851 /// The Child property of FlexContainer.<br />
852 /// The space around the flex item.<br />
855 /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
857 /// <since_tizen> 3 </since_tizen>
858 [Obsolete("Deprecated in API8, will be removed in API10.")]
859 public Vector4 FlexMargin
863 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
864 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
868 SetValue(FlexMarginProperty, value);
869 NotifyPropertyChanged();
874 /// The top-left cell this child occupies, if not set, the first available cell is used.
877 /// The property cascade chaining set is not recommended.
878 /// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
881 /// This way is recommended for setting the property
883 /// var view = new View();
884 /// view.CellIndex = new Vector2(1, 3);
886 /// This way to set the property is prohibited
888 /// view.CellIndex.X = 1; //This does not guarantee a proper operation
891 /// <since_tizen> 3 </since_tizen>
892 public Vector2 CellIndex
896 return (Vector2)GetValue(CellIndexProperty);
900 SetValue(CellIndexProperty, value);
901 NotifyPropertyChanged();
906 /// The number of rows this child occupies, if not set, the default value is 1.
909 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
911 /// <since_tizen> 3 </since_tizen>
916 return (float)GetValue(RowSpanProperty);
920 SetValue(RowSpanProperty, value);
921 NotifyPropertyChanged();
926 /// The number of columns this child occupies, if not set, the default value is 1.
929 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
931 /// <since_tizen> 3 </since_tizen>
932 public float ColumnSpan
936 return (float)GetValue(ColumnSpanProperty);
940 SetValue(ColumnSpanProperty, value);
941 NotifyPropertyChanged();
946 /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
949 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
951 /// <since_tizen> 3 </since_tizen>
952 public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
956 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
960 SetValue(CellHorizontalAlignmentProperty, value);
961 NotifyPropertyChanged();
966 /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
969 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
971 /// <since_tizen> 3 </since_tizen>
972 public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
976 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
980 SetValue(CellVerticalAlignmentProperty, value);
981 NotifyPropertyChanged();
986 /// The left focusable view.<br />
987 /// This will return null if not set.<br />
988 /// This will also return null if the specified left focusable view is not on a window.<br />
990 /// <since_tizen> 3 </since_tizen>
991 public View LeftFocusableView
993 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
996 return (View)GetValue(LeftFocusableViewProperty);
1000 SetValue(LeftFocusableViewProperty, value);
1001 NotifyPropertyChanged();
1006 /// The right focusable view.<br />
1007 /// This will return null if not set.<br />
1008 /// This will also return null if the specified right focusable view is not on a window.<br />
1010 /// <since_tizen> 3 </since_tizen>
1011 public View RightFocusableView
1013 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1016 return (View)GetValue(RightFocusableViewProperty);
1020 SetValue(RightFocusableViewProperty, value);
1021 NotifyPropertyChanged();
1026 /// The up focusable view.<br />
1027 /// This will return null if not set.<br />
1028 /// This will also return null if the specified up focusable view is not on a window.<br />
1030 /// <since_tizen> 3 </since_tizen>
1031 public View UpFocusableView
1033 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1036 return (View)GetValue(UpFocusableViewProperty);
1040 SetValue(UpFocusableViewProperty, value);
1041 NotifyPropertyChanged();
1046 /// The down focusable view.<br />
1047 /// This will return null if not set.<br />
1048 /// This will also return null if the specified down focusable view is not on a window.<br />
1050 /// <since_tizen> 3 </since_tizen>
1051 public View DownFocusableView
1053 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1056 return (View)GetValue(DownFocusableViewProperty);
1060 SetValue(DownFocusableViewProperty, value);
1061 NotifyPropertyChanged();
1066 /// The clockwise focusable view by rotary wheel.<br />
1067 /// This will return null if not set.<br />
1068 /// This will also return null if the specified clockwise focusable view is not on a window.<br />
1070 [EditorBrowsable(EditorBrowsableState.Never)]
1071 public View ClockwiseFocusableView
1073 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1076 return (View)GetValue(ClockwiseFocusableViewProperty);
1080 SetValue(ClockwiseFocusableViewProperty, value);
1081 NotifyPropertyChanged();
1086 /// The counter clockwise focusable view by rotary wheel.<br />
1087 /// This will return null if not set.<br />
1088 /// This will also return null if the specified counter clockwise focusable view is not on a window.<br />
1090 [EditorBrowsable(EditorBrowsableState.Never)]
1091 public View CounterClockwiseFocusableView
1093 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1096 return (View)GetValue(CounterClockwiseFocusableViewProperty);
1100 SetValue(CounterClockwiseFocusableViewProperty, value);
1101 NotifyPropertyChanged();
1106 /// Whether the view should be focusable by keyboard navigation.
1108 /// <since_tizen> 3 </since_tizen>
1109 public bool Focusable
1113 SetValue(FocusableProperty, value);
1114 NotifyPropertyChanged();
1118 return (bool)GetValue(FocusableProperty);
1123 /// 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.
1124 /// Note : Default value is true.
1126 [EditorBrowsable(EditorBrowsableState.Never)]
1127 public bool FocusableChildren
1131 SetValue(FocusableChildrenProperty, value);
1132 NotifyPropertyChanged();
1136 return (bool)GetValue(FocusableChildrenProperty);
1141 /// Whether this view can focus by touch.
1142 /// If Focusable is false, FocusableInTouch is disabled.
1143 /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
1145 [EditorBrowsable(EditorBrowsableState.Never)]
1146 public bool FocusableInTouch
1150 SetValue(FocusableInTouchProperty, value);
1151 NotifyPropertyChanged();
1155 return (bool)GetValue(FocusableInTouchProperty);
1160 /// Retrieves the position of the view.<br />
1161 /// The coordinates are relative to the view's parent.<br />
1163 /// <since_tizen> 3 </since_tizen>
1164 public Position CurrentPosition
1168 return GetCurrentPosition();
1173 /// Sets the size of a view for the width and the height.<br />
1174 /// Geometry can be scaled to fit within this area.<br />
1175 /// This does not interfere with the view's scale factor.<br />
1176 /// The views default depth is the minimum of width and height.<br />
1179 /// The property cascade chaining set is not recommended.
1182 /// This way is recommended for setting the property
1184 /// var view = new View();
1185 /// view.Size2D = new Size2D(100, 200);
1187 /// This way to set the property is prohibited
1189 /// view.Size2D.Width = 100; //This does not guarantee a proper operation
1192 /// <since_tizen> 3 </since_tizen>
1193 public Size2D Size2D
1197 var temp = (Size2D)GetValue(Size2DProperty);
1199 if (this.Layout == null)
1201 if (temp.Width < 0) { temp.Width = 0; }
1202 if (temp.Height < 0) { temp.Height = 0; }
1209 SetValue(Size2DProperty, value);
1211 NotifyPropertyChanged();
1216 /// Retrieves the size of the view.<br />
1217 /// The coordinates are relative to the view's parent.<br />
1219 /// <since_tizen> 3 </since_tizen>
1220 public Size2D CurrentSize
1224 return GetCurrentSize();
1229 /// Retrieves and sets the view's opacity.<br />
1233 /// Animatable - This property can be animated using <c>Animation</c> class.
1235 /// animation.AnimateTo(view, "Opacity", 0.5f);
1239 /// <since_tizen> 3 </since_tizen>
1240 public float Opacity
1244 return (float)GetValue(OpacityProperty);
1248 SetValue(OpacityProperty, value);
1249 NotifyPropertyChanged();
1254 /// Sets the position of the view for X and Y.<br />
1255 /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1256 /// If the position inheritance is disabled, sets the world position.<br />
1259 /// The property cascade chaining set is not recommended.
1262 /// This way is recommended for setting the property
1264 /// var view = new View();
1265 /// view.Position2D = new Position2D(100, 200);
1267 /// This way to set the property is prohibited
1269 /// view.Position2D.X = 100; //This does not guarantee a proper operation
1272 /// <since_tizen> 3 </since_tizen>
1273 public Position2D Position2D
1277 return (Position2D)GetValue(Position2DProperty);
1281 SetValue(Position2DProperty, value);
1282 NotifyPropertyChanged();
1287 /// Retrieves the screen position of the view.<br />
1289 /// <since_tizen> 3 </since_tizen>
1290 public Vector2 ScreenPosition
1294 Vector2 temp = new Vector2(0.0f, 0.0f);
1295 var pValue = GetProperty(View.Property.ScreenPosition);
1303 /// Determines whether the pivot point should be used to determine the position of the view.
1304 /// This is false by default.
1306 /// <remarks>If false, then the top-left of the view is used for the position.
1307 /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1309 /// <since_tizen> 3 </since_tizen>
1310 public bool PositionUsesPivotPoint
1314 return (bool)GetValue(PositionUsesPivotPointProperty);
1318 SetValue(PositionUsesPivotPointProperty, value);
1319 NotifyPropertyChanged();
1324 /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead.
1326 /// <since_tizen> 3 </since_tizen>
1327 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PositionUsesPivotPoint instead. " +
1329 "View view = new View(); " +
1330 "view.PivotPoint = PivotPoint.Center; " +
1331 "view.PositionUsesPivotPoint = true;" +
1332 " This has been deprecated in API5 and will be removed in API8")]
1333 [EditorBrowsable(EditorBrowsableState.Never)]
1334 public bool PositionUsesAnchorPoint
1338 return (bool)GetValue(PositionUsesAnchorPointProperty);
1342 SetValue(PositionUsesAnchorPointProperty, value);
1346 private bool InternalPositionUsesAnchorPoint
1351 var pValue = GetProperty(View.Property.PositionUsesAnchorPoint);
1352 pValue.Get(out temp);
1358 var temp = new Tizen.NUI.PropertyValue(value);
1359 SetProperty(View.Property.PositionUsesAnchorPoint, temp);
1361 NotifyPropertyChanged();
1366 /// Queries whether the view is connected to the stage.<br />
1367 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1369 /// <since_tizen> 3 </since_tizen>
1370 public bool IsOnWindow
1379 /// Gets the depth in the hierarchy for the view.
1381 /// <since_tizen> 3 </since_tizen>
1382 public int HierarchyDepth
1386 return GetHierarchyDepth();
1391 /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1394 /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1395 /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1396 /// The values set by this property will likely change.
1398 /// <since_tizen> 3 </since_tizen>
1399 public int SiblingOrder
1403 return (int)GetValue(SiblingOrderProperty);
1407 SetValue(SiblingOrderProperty, value);
1409 Layout?.ChangeLayoutSiblingOrder(value);
1411 NotifyPropertyChanged();
1416 /// Returns the natural size of the view.
1419 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1421 /// <since_tizen> 5 </since_tizen>
1422 public Vector3 NaturalSize
1426 Vector3 ret = GetNaturalSize();
1427 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1433 /// Returns the natural size (Size2D) of the view.
1436 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1438 /// <since_tizen> 4 </since_tizen>
1439 public Size2D NaturalSize2D
1443 Vector3 temp = GetNaturalSize();
1444 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1446 Size2D sz = new Size2D((int)temp.Width, (int)temp.Height);
1453 /// Gets or sets the origin of a view within its parent's area.<br />
1454 /// 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 />
1455 /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1456 /// A view's position is the distance between this origin and the view's anchor-point.<br />
1458 /// <pre>The view has been initialized.</pre>
1459 /// <since_tizen> 3 </since_tizen>
1460 public Position ParentOrigin
1464 Position tmp = (Position)GetValue(ParentOriginProperty);
1465 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1469 SetValue(ParentOriginProperty, value);
1470 NotifyPropertyChanged();
1475 /// Gets or sets the anchor-point of a view.<br />
1476 /// 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 />
1477 /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1478 /// A view position is the distance between its parent-origin and this anchor-point.<br />
1479 /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1480 /// <pre>The view has been initialized.</pre>
1483 /// The property cascade chaining set is not recommended.
1486 /// This way is recommended for setting the property
1488 /// var view = new View();
1489 /// view.PivotPoint = PivotPoint.Center;
1491 /// This way to set the property is prohibited
1493 /// view.PivotPoint.X = 0.5f; //This does not guarantee a proper operation
1496 /// <since_tizen> 3 </since_tizen>
1497 public Position PivotPoint
1501 return (Position)GetValue(PivotPointProperty);
1505 SetValue(PivotPointProperty, value);
1506 NotifyPropertyChanged();
1511 /// Gets or sets the size width of the view.
1515 /// Animatable - This property can be animated using <c>Animation</c> class.
1517 /// animation.AnimateTo(view, "SizeWidth", 500.0f);
1521 /// <since_tizen> 3 </since_tizen>
1522 public float SizeWidth
1526 return (float)GetValue(SizeWidthProperty);
1530 SetValue(SizeWidthProperty, value);
1531 NotifyPropertyChanged();
1536 /// Gets or sets the size height of the view.
1540 /// Animatable - This property can be animated using <c>Animation</c> class.
1543 /// animation.AnimateTo(view, "SizeHeight", 500.0f);
1546 /// <since_tizen> 3 </since_tizen>
1547 public float SizeHeight
1551 return (float)GetValue(SizeHeightProperty);
1555 SetValue(SizeHeightProperty, value);
1556 NotifyPropertyChanged();
1561 /// Gets or sets the position of the view.<br />
1562 /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1563 /// If the position inheritance is disabled, sets the world position.<br />
1567 /// Animatable - This property can be animated using <c>Animation</c> class.
1569 /// animation.AnimateTo(view, "Position", new Position(50, 0));
1572 /// The property cascade chaining set is not recommended.
1575 /// This way is recommended for setting the property
1577 /// var view = new View();
1578 /// view.Position = new Position(100, 200.5f, 0);
1580 /// This way to set the property is prohibited
1582 /// view.Position.Y = 200.5f; //This does not guarantee a proper operation
1585 /// <since_tizen> 3 </since_tizen>
1586 public Position Position
1590 return (Position)GetValue(PositionProperty);
1594 SetValue(PositionProperty, value);
1595 NotifyPropertyChanged();
1600 /// Gets or sets the position X of the view.
1604 /// Animatable - This property can be animated using <c>Animation</c> class.
1606 /// animation.AnimateTo(view, "PositionX", 50.0f);
1610 /// <since_tizen> 3 </since_tizen>
1611 public float PositionX
1615 return (float)GetValue(PositionXProperty);
1619 SetValue(PositionXProperty, value);
1620 NotifyPropertyChanged();
1625 /// Gets or sets the position Y of the view.
1629 /// Animatable - This property can be animated using <c>Animation</c> class.
1631 /// animation.AnimateTo(view, "PositionY", 50.0f);
1635 /// <since_tizen> 3 </since_tizen>
1636 public float PositionY
1640 return (float)GetValue(PositionYProperty);
1644 SetValue(PositionYProperty, value);
1645 NotifyPropertyChanged();
1650 /// Gets or sets the position Z of the view.
1654 /// Animatable - This property can be animated using <c>Animation</c> class.
1656 /// animation.AnimateTo(view, "PositionZ", 50.0f);
1660 /// <since_tizen> 3 </since_tizen>
1661 public float PositionZ
1665 return (float)GetValue(PositionZProperty);
1669 SetValue(PositionZProperty, value);
1670 NotifyPropertyChanged();
1675 /// Gets or sets the world position of the view.
1677 /// <since_tizen> 3 </since_tizen>
1678 public Vector3 WorldPosition
1682 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1683 var pValue = GetProperty(View.Property.WorldPosition);
1691 /// Gets or sets the orientation of the view.<br />
1692 /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1696 /// This is an asynchronous method.
1699 /// Animatable - This property can be animated using <c>Animation</c> class.
1701 /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
1705 /// <since_tizen> 3 </since_tizen>
1706 public Rotation Orientation
1710 return (Rotation)GetValue(OrientationProperty);
1714 SetValue(OrientationProperty, value);
1715 NotifyPropertyChanged();
1720 /// Gets or sets the world orientation of the view.<br />
1722 /// <since_tizen> 3 </since_tizen>
1723 public Rotation WorldOrientation
1727 Rotation temp = new Rotation();
1728 var pValue = GetProperty(View.Property.WorldOrientation);
1736 /// Gets or sets the scale factor applied to the view.<br />
1740 /// Animatable - This property can be animated using <c>Animation</c> class.
1742 /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
1745 /// The property cascade chaining set is not recommended.
1748 /// This way is recommended for setting the property
1750 /// var view = new View();
1751 /// view.Scale = new Vector3(1.5f, 2.0f, 1.0f);
1753 /// This way to set the property is prohibited
1755 /// view.Scale.Width = 1.5f; //This does not guarantee a proper operation
1758 /// <since_tizen> 3 </since_tizen>
1759 public Vector3 Scale
1763 return (Vector3)GetValue(ScaleProperty);
1767 SetValue(ScaleProperty, value);
1768 NotifyPropertyChanged();
1773 /// Gets or sets the scale X factor applied to the view.
1777 /// Animatable - This property can be animated using <c>Animation</c> class.
1779 /// animation.AnimateTo(view, "ScaleX", 1.5f);
1783 /// <since_tizen> 3 </since_tizen>
1788 return (float)GetValue(ScaleXProperty);
1792 SetValue(ScaleXProperty, value);
1793 NotifyPropertyChanged();
1798 /// Gets or sets the scale Y factor applied to the view.
1802 /// Animatable - This property can be animated using <c>Animation</c> class.
1804 /// animation.AnimateTo(view, "ScaleY", 1.5f);
1808 /// <since_tizen> 3 </since_tizen>
1813 return (float)GetValue(ScaleYProperty);
1817 SetValue(ScaleYProperty, value);
1818 NotifyPropertyChanged();
1823 /// Gets or sets the scale Z factor applied to the view.
1827 /// Animatable - This property can be animated using <c>Animation</c> class.
1829 /// animation.AnimateTo(view, "ScaleZ", 1.5f);
1833 /// <since_tizen> 3 </since_tizen>
1838 return (float)GetValue(ScaleZProperty);
1842 SetValue(ScaleZProperty, value);
1843 NotifyPropertyChanged();
1848 /// Gets the world scale of the view.
1850 /// <since_tizen> 3 </since_tizen>
1851 public Vector3 WorldScale
1855 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1856 var pValue = GetProperty(View.Property.WorldScale);
1864 /// Retrieves the visibility flag of the view.
1868 /// If the view is not visible, then the view and its children will not be rendered.
1869 /// 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.
1872 /// Animatable - This property can be animated using <c>Animation</c> class.
1874 /// animation.AnimateTo(view, "Visibility", false);
1878 /// <since_tizen> 3 </since_tizen>
1879 public bool Visibility
1884 var pValue = GetProperty(View.Property.VISIBLE);
1885 pValue.Get(out temp);
1892 /// Gets the view's world color.
1894 /// <since_tizen> 3 </since_tizen>
1895 public Vector4 WorldColor
1899 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
1900 var pValue = GetProperty(View.Property.WorldColor);
1908 /// Gets or sets the view's name.
1910 /// <since_tizen> 3 </since_tizen>
1915 return (string)GetValue(NameProperty);
1919 SetValue(NameProperty, value);
1920 NotifyPropertyChanged();
1925 /// Get the number of children held by the view.
1927 /// <since_tizen> 3 </since_tizen>
1928 public new uint ChildCount
1932 return Convert.ToUInt32(Children.Count);
1937 /// Gets the view's ID.
1940 /// <since_tizen> 3 </since_tizen>
1950 /// Gets or sets the status of whether the view should emit touch or hover signals.
1951 /// If a View is made insensitive, then the View and its children are not hittable.
1953 /// <since_tizen> 3 </since_tizen>
1954 public bool Sensitive
1958 return (bool)GetValue(SensitiveProperty);
1962 SetValue(SensitiveProperty, value);
1963 NotifyPropertyChanged();
1968 /// Gets or sets the status of whether the view should be enabled user interactions.
1969 /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled.
1971 /// <since_tizen> tizen_next </since_tizen>
1972 [EditorBrowsable(EditorBrowsableState.Never)]
1973 public bool IsEnabled
1977 return (bool)GetValue(IsEnabledProperty);
1981 SetValue(IsEnabledProperty, value);
1982 NotifyPropertyChanged();
1987 /// 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.
1989 /// <since_tizen> 3 </since_tizen>
1990 public bool LeaveRequired
1994 return (bool)GetValue(LeaveRequiredProperty);
1998 SetValue(LeaveRequiredProperty, value);
1999 NotifyPropertyChanged();
2004 /// Gets or sets the status of whether a child view inherits it's parent's orientation.
2006 /// <since_tizen> 3 </since_tizen>
2007 public bool InheritOrientation
2011 return (bool)GetValue(InheritOrientationProperty);
2015 SetValue(InheritOrientationProperty, value);
2016 NotifyPropertyChanged();
2021 /// Gets or sets the status of whether a child view inherits it's parent's scale.
2023 /// <since_tizen> 3 </since_tizen>
2024 public bool InheritScale
2028 return (bool)GetValue(InheritScaleProperty);
2032 SetValue(InheritScaleProperty, value);
2033 NotifyPropertyChanged();
2038 /// Gets or sets the status of how the view and its children should be drawn.<br />
2039 /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
2040 /// 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 />
2041 /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
2042 /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
2043 /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
2045 /// <since_tizen> 3 </since_tizen>
2046 public DrawModeType DrawMode
2050 return (DrawModeType)GetValue(DrawModeProperty);
2054 SetValue(DrawModeProperty, value);
2055 NotifyPropertyChanged();
2060 /// Gets or sets the relative to parent size factor of the view.<br />
2061 /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
2062 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
2065 /// The property cascade chaining set is not recommended.
2068 /// This way is recommended for setting the property
2070 /// var text = new TextField();
2071 /// text.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
2073 /// This way to set the property is prohibited
2075 /// text.SizeModeFactor.Width = 1.0f; //This does not guarantee a proper operation
2078 /// <since_tizen> 3 </since_tizen>
2079 public Vector3 SizeModeFactor
2083 return (Vector3)GetValue(SizeModeFactorProperty);
2087 SetValue(SizeModeFactorProperty, value);
2088 NotifyPropertyChanged();
2093 /// Gets or sets the width resize policy to be used.
2095 /// <since_tizen> 3 </since_tizen>
2096 public ResizePolicyType WidthResizePolicy
2100 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
2104 SetValue(WidthResizePolicyProperty, value);
2105 NotifyPropertyChanged();
2110 /// Gets or sets the height resize policy to be used.
2112 /// <since_tizen> 3 </since_tizen>
2113 public ResizePolicyType HeightResizePolicy
2117 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
2121 SetValue(HeightResizePolicyProperty, value);
2122 NotifyPropertyChanged();
2127 /// Gets or sets the policy to use when setting size with size negotiation.<br />
2128 /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
2130 /// <since_tizen> 3 </since_tizen>
2131 public SizeScalePolicyType SizeScalePolicy
2135 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
2139 SetValue(SizeScalePolicyProperty, value);
2140 NotifyPropertyChanged();
2145 /// Gets or sets the status of whether the width size is dependent on the height size.
2147 /// <since_tizen> 3 </since_tizen>
2148 public bool WidthForHeight
2152 return (bool)GetValue(WidthForHeightProperty);
2156 SetValue(WidthForHeightProperty, value);
2157 NotifyPropertyChanged();
2162 /// Gets or sets the status of whether the height size is dependent on the width size.
2164 /// <since_tizen> 3 </since_tizen>
2165 public bool HeightForWidth
2169 return (bool)GetValue(HeightForWidthProperty);
2173 SetValue(HeightForWidthProperty, value);
2174 NotifyPropertyChanged();
2179 /// Gets or sets the padding for use in layout.
2182 /// The property cascade chaining set is not recommended.
2185 /// This way is recommended for setting the property
2187 /// var view = new View();
2188 /// view.Padding = new Extents(5, 5, 5, 5);
2190 /// This way to set the property is prohibited
2192 /// view.Padding.Start = 5; //This does not guarantee a proper operation
2195 /// <since_tizen> 5 </since_tizen>
2196 public Extents Padding
2200 return (Extents)GetValue(PaddingProperty);
2204 SetValue(PaddingProperty, value);
2205 NotifyPropertyChanged();
2210 /// Gets or sets the minimum size the view can be assigned in size negotiation.
2212 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2214 /// The property cascade chaining set is not recommended.
2217 /// This way is recommended for setting the property
2219 /// var view = new View();
2220 /// view.MinimumSize = new Size2D(100, 200);
2222 /// This way to set the property is prohibited
2224 /// view.MinimumSize.Width = 100; //This does not guarantee a proper operation
2227 /// <since_tizen> 3 </since_tizen>
2228 public Size2D MinimumSize
2232 return (Size2D)GetValue(MinimumSizeProperty);
2238 throw new ArgumentNullException(nameof(value));
2242 // Note: it only works if minimum size is >= than natural size.
2243 // To force the size it should be done through the width&height spec or Size2D.
2244 layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
2245 layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
2246 layout.RequestLayout();
2248 SetValue(MinimumSizeProperty, value);
2249 NotifyPropertyChanged();
2254 /// Gets or sets the maximum size the view can be assigned in size negotiation.
2257 /// This way is recommended for setting the property
2259 /// var view = new View();
2260 /// view.MaximumSize = new Size2D(100, 200);
2262 /// This way to set the property is prohibited
2264 /// view.MaximumSize.Height = 200; //This does not guarantee a proper operation
2267 /// <since_tizen> 3 </since_tizen>
2268 public Size2D MaximumSize
2272 return (Size2D)GetValue(MaximumSizeProperty);
2276 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
2277 // MATCH_PARENT spec + parent container size can be used to limit
2280 layout.RequestLayout();
2282 SetValue(MaximumSizeProperty, value);
2283 NotifyPropertyChanged();
2288 /// Gets or sets whether a child view inherits it's parent's position.<br />
2289 /// Default is to inherit.<br />
2290 /// 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 />
2292 /// <since_tizen> 3 </since_tizen>
2293 public bool InheritPosition
2297 return (bool)GetValue(InheritPositionProperty);
2301 SetValue(InheritPositionProperty, value);
2302 NotifyPropertyChanged();
2307 /// Gets or sets the clipping behavior (mode) of it's children.
2309 /// <since_tizen> 3 </since_tizen>
2310 public ClippingModeType ClippingMode
2314 return (ClippingModeType)GetValue(ClippingModeProperty);
2318 SetValue(ClippingModeProperty, value);
2319 NotifyPropertyChanged();
2324 /// Gets the number of renderers held by the view.
2326 /// <since_tizen> 3 </since_tizen>
2327 public uint RendererCount
2331 return GetRendererCount();
2336 /// This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead.
2339 /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2341 /// <since_tizen> 3 </since_tizen>
2342 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead. " +
2344 "View view = new View(); " +
2345 "view.PivotPoint = PivotPoint.Center; " +
2346 "view.PositionUsesPivotPoint = true;")]
2347 [EditorBrowsable(EditorBrowsableState.Never)]
2348 public Position AnchorPoint
2352 return GetValue(AnchorPointProperty) as Position;
2356 SetValue(AnchorPointProperty, value);
2360 private Position InternalAnchorPoint
2364 Position temp = new Position(0.0f, 0.0f, 0.0f);
2365 var pValue = GetProperty(View.Property.AnchorPoint);
2368 Position ret = new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
2374 var temp = new Tizen.NUI.PropertyValue(value);
2375 SetProperty(View.Property.AnchorPoint, temp);
2377 NotifyPropertyChanged();
2382 /// Sets the size of a view for the width, the height and the depth.<br />
2383 /// Geometry can be scaled to fit within this area.<br />
2384 /// This does not interfere with the view's scale factor.<br />
2385 /// The views default depth is the minimum of width and height.<br />
2389 /// Animatable - This property can be animated using <c>Animation</c> class.
2391 /// animation.AnimateTo(view, "Size", new Size(100, 100));
2394 /// The property cascade chaining set is not recommended.
2397 /// This way is recommended for setting the property
2399 /// var view = new View();
2400 /// view.Size = new Size(100.5f, 200, 0);
2402 /// This way to set the property is prohibited
2404 /// view.Size.Width = 100.5f; //This does not guarantee a proper operation
2407 /// <since_tizen> 5 </since_tizen>
2412 return (Size)GetValue(SizeProperty);
2416 SetValue(SizeProperty, value);
2417 NotifyPropertyChanged();
2422 /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead.
2424 /// <since_tizen> 3 </since_tizen>
2425 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. " +
2427 "Container parent = view.GetParent(); " +
2428 "View view = parent as View;")]
2429 [EditorBrowsable(EditorBrowsableState.Never)]
2430 public new View Parent
2435 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2436 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2437 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2439 if (basehandle is Layer layer)
2441 ret = new View(Layer.getCPtr(layer).Handle, false);
2442 NUILog.Error("This Parent property is deprecated, should do not be used");
2446 ret = basehandle as View;
2449 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2450 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2452 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2458 /// Gets/Sets whether inherit parent's the layout Direction.
2460 /// <since_tizen> 4 </since_tizen>
2461 public bool InheritLayoutDirection
2465 return (bool)GetValue(InheritLayoutDirectionProperty);
2469 SetValue(InheritLayoutDirectionProperty, value);
2470 NotifyPropertyChanged();
2475 /// Gets/Sets the layout Direction.
2477 /// <since_tizen> 4 </since_tizen>
2478 public ViewLayoutDirectionType LayoutDirection
2482 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2486 SetValue(LayoutDirectionProperty, value);
2487 NotifyPropertyChanged();
2488 layout?.RequestLayout();
2493 /// Gets or sets the Margin for use in layout.
2496 /// Margin property is supported by Layout algorithms and containers.
2497 /// Please Set Layout if you want to use Margin property.
2498 /// The property cascade chaining set is not recommended.
2501 /// This way is recommended for setting the property
2503 /// var view = new View();
2504 /// view.Margin = new Extents(10, 5, 15, 20);
2506 /// This way to set the property is prohibited
2508 /// view.Margin.Top = 15; //This does not guarantee a proper operation
2511 /// <since_tizen> 4 </since_tizen>
2512 public Extents Margin
2516 return (Extents)GetValue(MarginProperty);
2520 SetValue(MarginProperty, value);
2521 NotifyPropertyChanged();
2526 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2530 /// // matchParentView matches its size to its parent size.
2531 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2532 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2534 /// // wrapContentView wraps its children with their desired size.
2535 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2536 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2538 /// // exactSizeView shows itself with an exact size.
2539 /// exactSizeView.WidthSpecification = 100;
2540 /// exactSizeView.HeightSpecification = 100;
2543 /// <since_tizen> 6 </since_tizen>
2544 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2545 public int WidthSpecification
2549 return (int)GetValue(WidthSpecificationProperty);
2553 SetValue(WidthSpecificationProperty, value);
2554 NotifyPropertyChanged();
2558 private int InternalWidthSpecification
2566 if (value == widthPolicy)
2569 widthPolicy = value;
2570 if (widthPolicy >= 0)
2572 if (heightPolicy >= 0) // Policy an exact value
2574 // Create Size2D only both _widthPolicy and _heightPolicy are set.
2575 Size2D = new Size2D(widthPolicy, heightPolicy);
2578 layout?.RequestLayout();
2583 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2587 /// // matchParentView matches its size to its parent size.
2588 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2589 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2591 /// // wrapContentView wraps its children with their desired size.
2592 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2593 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2595 /// // exactSizeView shows itself with an exact size.
2596 /// exactSizeView.WidthSpecification = 100;
2597 /// exactSizeView.HeightSpecification = 100;
2600 /// <since_tizen> 6 </since_tizen>
2601 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2602 public int HeightSpecification
2606 return (int)GetValue(HeightSpecificationProperty);
2610 SetValue(HeightSpecificationProperty, value);
2611 NotifyPropertyChanged();
2615 private int InternalHeightSpecification
2619 return heightPolicy;
2623 if (value == heightPolicy)
2626 heightPolicy = value;
2627 if (heightPolicy >= 0)
2629 if (widthPolicy >= 0) // Policy an exact value
2631 // Create Size2D only both _widthPolicy and _heightPolicy are set.
2632 Size2D = new Size2D(widthPolicy, heightPolicy);
2635 layout?.RequestLayout();
2640 /// Gets the List of transitions for this View.
2642 /// <since_tizen> 6 </since_tizen>
2643 public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2647 if (layoutTransitions == null)
2649 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2651 return layoutTransitions;
2656 /// Sets a layout transitions for this View.
2658 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2660 /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2662 /// <since_tizen> 6 </since_tizen>
2663 public LayoutTransition LayoutTransition
2667 return GetValue(LayoutTransitionProperty) as LayoutTransition;
2671 SetValue(LayoutTransitionProperty, value);
2672 NotifyPropertyChanged();
2676 private LayoutTransition InternalLayoutTransition
2680 return layoutTransition;
2686 throw new global::System.ArgumentNullException(nameof(value));
2688 if (layoutTransitions == null)
2690 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2693 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
2695 AttachTransitionsToChildren(value);
2697 layoutTransition = value;
2702 /// This has been deprecated in API5 and will be removed in API8. Use Padding instead.
2705 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2707 /// <since_tizen> 4 </since_tizen>
2708 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use Padding instead.")]
2709 [EditorBrowsable(EditorBrowsableState.Never)]
2710 public Extents PaddingEX
2714 return GetValue(PaddingEXProperty) as Extents;
2718 SetValue(PaddingEXProperty, value);
2722 private Extents InternalPaddingEX
2726 Extents temp = new Extents(0, 0, 0, 0);
2727 var pValue = GetProperty(View.Property.PADDING);
2730 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2736 var temp = new Tizen.NUI.PropertyValue(value);
2737 SetProperty(View.Property.PADDING, temp);
2739 NotifyPropertyChanged();
2740 layout?.RequestLayout();
2745 /// The Color of View. This is an RGBA value.
2749 /// Animatable - This property can be animated using <c>Animation</c> class.
2751 /// The property cascade chaining set is not recommended.
2754 /// This way is recommended for setting the property
2756 /// var view = new View();
2757 /// view.Color = new Color(0.5f, 0.2f, 0.1f, 0.5f);
2759 /// This way to set the property is prohibited
2761 /// view.Color.A = 0.5f; //This does not guarantee a proper operation
2764 [EditorBrowsable(EditorBrowsableState.Never)]
2769 return (Color)GetValue(ColorProperty);
2773 SetValue(ColorProperty, value);
2774 NotifyPropertyChanged();
2779 /// Set the layout on this View. Replaces any existing Layout.
2782 /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
2784 /// <since_tizen> 6 </since_tizen>
2785 public LayoutItem Layout
2789 return GetValue(LayoutProperty) as LayoutItem;
2793 SetValue(LayoutProperty, value);
2797 private LayoutItem InternalLayout
2805 // Do nothing if layout provided is already set on this View.
2806 if (value == layout)
2811 LayoutingDisabled = false;
2814 // If new layout being set already has a owner then that owner receives a replacement default layout.
2815 // First check if the layout to be set already has a owner.
2816 if (value?.Owner != null)
2818 // Previous owner of the layout gets a default layout as a replacement.
2819 value.Owner.Layout = new AbsoluteLayout()
2821 // Copy Margin and Padding to replacement LayoutGroup.
2822 Margin = value.Margin,
2823 Padding = value.Padding,
2827 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2828 // View if no replacement. Previously margin and padding values would have been moved from
2829 // the View to the layout.
2830 if (layout != null) // Existing layout
2834 // Existing layout being replaced so copy over margin and padding values.
2835 value.Margin = layout.Margin;
2836 value.Padding = layout.Padding;
2837 value.SetPositionByLayout = !excludeLayouting;
2841 // Layout not being replaced so restore margin and padding to View.
2842 SetValue(MarginProperty, layout.Margin);
2843 SetValue(PaddingProperty, layout.Padding);
2844 NotifyPropertyChanged();
2849 // First Layout to be added to the View hence copy
2851 // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2854 Extents margin = Margin;
2855 Extents padding = Padding;
2856 bool setMargin = false;
2857 bool setPadding = false;
2859 if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
2861 // If View already has a margin set then store it in Layout instead.
2862 value.Margin = margin;
2863 SetValue(MarginProperty, new Extents(0, 0, 0, 0));
2867 if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
2869 // If View already has a padding set then store it in Layout instead.
2870 value.Padding = padding;
2871 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
2875 if (setMargin || setPadding)
2877 NotifyPropertyChanged();
2880 value.SetPositionByLayout = !excludeLayouting;
2884 // Remove existing layout from it's parent layout group.
2887 // Set layout to this view
2893 /// The weight of the View, used to share available space in a layout with siblings.
2895 /// <since_tizen> 6 </since_tizen>
2905 layout?.RequestLayout();
2910 /// Whether to load the BackgroundImage synchronously.
2911 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
2912 /// Note: For Normal Quad images only.
2914 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2915 [EditorBrowsable(EditorBrowsableState.Never)]
2916 public bool BackgroundImageSynchronosLoading
2920 return (bool)GetValue(BackgroundImageSynchronosLoadingProperty);
2924 SetValue(BackgroundImageSynchronosLoadingProperty, value);
2925 NotifyPropertyChanged();
2929 private bool InternalBackgroundImageSynchronosLoading
2933 return BackgroundImageSynchronousLoading;
2937 BackgroundImageSynchronousLoading = value;
2942 /// Whether to load the BackgroundImage synchronously.
2943 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
2944 /// Note: For Normal Quad images only.
2946 /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2947 [EditorBrowsable(EditorBrowsableState.Never)]
2948 public bool BackgroundImageSynchronousLoading
2952 return (bool)GetValue(BackgroundImageSynchronousLoadingProperty);
2956 SetValue(BackgroundImageSynchronousLoadingProperty, value);
2957 NotifyPropertyChanged();
2961 private bool InternalBackgroundImageSynchronousLoading
2965 return backgroundImageSynchronousLoading;
2969 backgroundImageSynchronousLoading = value;
2971 string bgUrl = null;
2972 var pValue = Background.Find(ImageVisualProperty.URL);
2973 pValue?.Get(out bgUrl);
2976 if (!string.IsNullOrEmpty(bgUrl))
2978 PropertyMap bgMap = this.Background;
2979 var temp = new PropertyValue(backgroundImageSynchronousLoading);
2980 bgMap[ImageVisualProperty.SynchronousLoading] = temp;
2987 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2988 [EditorBrowsable(EditorBrowsableState.Never)]
2989 public Vector2 UpdateSizeHint
2993 return (Vector2)GetValue(UpdateSizeHintProperty);
2997 SetValue(UpdateSizeHintProperty, value);
2998 NotifyPropertyChanged();
3003 /// Enable/Disable ControlState propagation for children.
3004 /// It is false by default.
3005 /// If the View needs to share ControlState with descendants, please set it true.
3006 /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
3008 [EditorBrowsable(EditorBrowsableState.Never)]
3009 public bool EnableControlStatePropagation
3013 return (bool)GetValue(EnableControlStatePropagationProperty);
3017 SetValue(EnableControlStatePropagationProperty, value);
3018 NotifyPropertyChanged();
3022 private bool InternalEnableControlStatePropagation
3024 get => themeData?.ControlStatePropagation ?? false;
3027 if (InternalEnableControlStatePropagation == value) return;
3029 if (themeData == null) themeData = new ThemeData();
3031 themeData.ControlStatePropagation = value;
3033 foreach (View child in Children)
3035 child.EnableControlStatePropagation = value;
3041 /// The ControlStates can propagate from the parent.
3042 /// Listed ControlStates will be accepted propagation of the parent ControlState changes
3043 /// if parent view EnableControlState is true.
3044 /// <see cref="EnableControlState"/>.
3045 /// Default is ControlState.All, so every ControlStates will be propagated from the parent.
3047 [EditorBrowsable(EditorBrowsableState.Never)]
3048 public ControlState PropagatableControlStates
3052 return (ControlState)GetValue(PropagatableControlStatesProperty);
3056 SetValue(PropagatableControlStatesProperty, value);
3057 NotifyPropertyChanged();
3061 private ControlState InternalPropagatableControlStates
3063 get => propagatableControlStates;
3064 set => propagatableControlStates = value;
3068 /// By default, it is false in View, true in Control.
3069 /// Note that if the value is true, the View will be a touch receptor.
3071 [EditorBrowsable(EditorBrowsableState.Never)]
3072 public bool EnableControlState
3076 return (bool)GetValue(EnableControlStateProperty);
3080 SetValue(EnableControlStateProperty, value);
3085 /// Whether the actor grab all touches even if touch leaves its boundary.
3087 /// <returns>true, if it grab all touch after start</returns>
3088 [EditorBrowsable(EditorBrowsableState.Never)]
3089 public bool GrabTouchAfterLeave
3093 return (bool)GetValue(GrabTouchAfterLeaveProperty);
3097 SetValue(GrabTouchAfterLeaveProperty, value);
3101 private bool InternalGrabTouchAfterLeave
3106 var pValue = GetProperty(View.Property.CaptureAllTouchAfterStart);
3107 pValue.Get(out temp);
3113 var temp = new Tizen.NUI.PropertyValue(value);
3114 SetProperty(View.Property.CaptureAllTouchAfterStart, temp);
3116 NotifyPropertyChanged();
3121 /// Whether the view will only receive own touch.
3123 /// <returns>true, if it only receives touches that started from itself.</returns>
3124 [EditorBrowsable(EditorBrowsableState.Never)]
3125 public bool AllowOnlyOwnTouch
3129 return (bool)GetValue(AllowOnlyOwnTouchProperty);
3133 SetValue(AllowOnlyOwnTouchProperty, value);
3137 private bool InternalAllowOnlyOwnTouch
3142 var pValue = GetProperty(View.Property.AllowOnlyOwnTouch);
3143 pValue.Get(out temp);
3149 var temp = new Tizen.NUI.PropertyValue(value);
3150 SetProperty(View.Property.AllowOnlyOwnTouch, temp);
3152 NotifyPropertyChanged();
3157 /// Determines which blend equation will be used to render renderers of this actor.
3159 /// <returns>blend equation enum currently assigned</returns>
3160 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
3161 [EditorBrowsable(EditorBrowsableState.Never)]
3162 public BlendEquationType BlendEquation
3166 return (BlendEquationType)GetValue(BlendEquationProperty);
3170 SetValue(BlendEquationProperty, value);
3174 private BlendEquationType InternalBlendEquation
3179 var pValue = GetProperty(View.Property.BlendEquation);
3180 pValue.Get(out temp);
3182 return (BlendEquationType)temp;
3186 var temp = new Tizen.NUI.PropertyValue((int)value);
3187 SetProperty(View.Property.BlendEquation, temp);
3189 NotifyPropertyChanged();
3194 /// If the value is true, the View will change its style as the theme changes.
3195 /// The default value is false in normal case but it can be true when the NUIApplication is created with <see cref="NUIApplication.ThemeOptions.ThemeChangeSensitive"/>.
3197 /// <since_tizen> 9 </since_tizen>
3198 public bool ThemeChangeSensitive
3200 get => (bool)GetValue(ThemeChangeSensitiveProperty);
3201 set => SetValue(ThemeChangeSensitiveProperty, value);
3205 /// Create Style, it is abstract function and must be override.
3207 [EditorBrowsable(EditorBrowsableState.Never)]
3208 protected virtual ViewStyle CreateViewStyle()
3210 return new ViewStyle();
3214 /// Called after the View's ControlStates changed.
3216 /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
3217 [EditorBrowsable(EditorBrowsableState.Never)]
3218 protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
3224 [EditorBrowsable(EditorBrowsableState.Never)]
3225 protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
3227 isThemeChanged = true;
3228 if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
3229 else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
3230 isThemeChanged = false;
3234 /// Apply style instance to the view.
3235 /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
3237 /// <since_tizen> 9 </since_tizen>
3238 public virtual void ApplyStyle(ViewStyle viewStyle)
3240 if (viewStyle == null || themeData?.viewStyle == viewStyle) return;
3242 if (themeData == null) themeData = new ThemeData();
3244 themeData.viewStyle = viewStyle;
3246 if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
3252 BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
3254 if (bindablePropertyOfView == null)
3259 var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
3260 viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
3262 foreach (var sourceProperty in dirtyStyleProperties)
3264 var sourceValue = viewStyle.GetValue(sourceProperty);
3266 if (sourceValue == null)
3271 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
3273 // Do not set value again when theme is changed and the value has been set already.
3274 if (isThemeChanged && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty))
3279 if (destinationProperty != null)
3281 InternalSetValue(destinationProperty, sourceValue);
3287 /// Get whether the View is culled or not.
3288 /// True means that the View is out of the view frustum.
3291 /// Hidden-API (Inhouse-API).
3293 [EditorBrowsable(EditorBrowsableState.Never)]
3299 var pValue = GetProperty(View.Property.Culled);
3300 pValue.Get(out temp);
3307 /// Set or Get TransitionOptions for the page transition.
3308 /// This property is used to define how this view will be transitioned during Page switching.
3310 /// <since_tizen> 9 </since_tizen>
3311 public TransitionOptions TransitionOptions
3315 return GetValue(TransitionOptionsProperty) as TransitionOptions;
3319 SetValue(TransitionOptionsProperty, value);
3320 NotifyPropertyChanged();
3324 private TransitionOptions InternalTransitionOptions
3328 transitionOptions = value;
3332 return transitionOptions;
3337 /// Gets or sets the status of whether the view should emit key event signals.
3338 /// If a View's DispatchKeyEvents is set to false, then it's children will not emit a key event signal either.
3340 [EditorBrowsable(EditorBrowsableState.Never)]
3341 public bool DispatchKeyEvents
3345 return (bool)GetValue(DispatchKeyEventsProperty);
3349 SetValue(DispatchKeyEventsProperty, value);
3350 NotifyPropertyChanged();
3355 /// Gets or sets the status of whether touch events can be dispatched.
3356 /// 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.
3357 /// This works without adding a TouchEvent callback in the View.
3359 /// 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.
3362 [EditorBrowsable(EditorBrowsableState.Never)]
3363 public bool DispatchTouchEvents
3367 return dispatchTouchEvents;
3371 if (dispatchTouchEvents != value)
3373 dispatchTouchEvents = value;
3374 if (dispatchTouchEvents == false)
3376 TouchEvent += OnDispatchTouchEvent;
3380 TouchEvent -= OnDispatchTouchEvent;
3386 private bool OnDispatchTouchEvent(object source, View.TouchEventArgs e)
3392 /// Called when the view is hit through TouchEvent or GestureEvent.
3393 /// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
3394 /// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
3395 /// User can override whether hit or not in HitTest.
3396 /// You can get the coordinates relative to tthe top-left of the hit view by touch.GetLocalPosition(0).
3397 /// or you can get the coordinates relative to the top-left of the screen by touch.GetScreenPosition(0).
3399 // <param name="touch"><see cref="Tizen.NUI.Touch"/>The touch data</param>
3400 [EditorBrowsable(EditorBrowsableState.Never)]
3401 protected virtual bool HitTest(Touch touch)