2 * Copyright(c) 2022 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.Collections.Generic;
19 using System.ComponentModel;
20 using System.Runtime.InteropServices;
21 using Tizen.NUI.Binding;
23 namespace Tizen.NUI.BaseComponents
26 /// View is the base class for all views.
28 /// <since_tizen> 3 </since_tizen>
29 public partial class View : Container, IResourcesProvider
31 private static HashSet<BindableProperty> positionPropertyGroup = new HashSet<BindableProperty>();
32 private static HashSet<BindableProperty> sizePropertyGroup = new HashSet<BindableProperty>();
33 private static HashSet<BindableProperty> scalePropertyGroup = new HashSet<BindableProperty>();
34 private static bool defaultGrabTouchAfterLeave = false;
35 private static bool defaultAllowOnlyOwnTouch = false;
37 internal BackgroundExtraData backgroundExtraData;
39 private bool layoutSet = false;
40 private LayoutItem layout; // Exclusive layout assigned to this View.
42 // List of transitions paired with the condition that uses the transition.
43 private Dictionary<TransitionCondition, TransitionList> layoutTransitions;
44 private int widthPolicy = LayoutParamPolicies.WrapContent; // Layout width policy
45 private int heightPolicy = LayoutParamPolicies.WrapContent; // Layout height policy
46 private float weight = 0.0f; // Weighting of child View in a Layout
47 private bool backgroundImageSynchronousLoading = false;
48 private bool excludeLayouting = false;
49 private LayoutTransition layoutTransition;
50 private TransitionOptions transitionOptions = null;
51 private ThemeData themeData;
52 private bool isThemeChanged = false;
54 // List of constraints
55 private Constraint widthConstraint = null;
56 private Constraint heightConstraint = null;
58 private Size2D internalMaximumSize = null;
59 private Size2D internalMinimumSize = null;
60 private Extents internalMargin = null;
61 private Extents internalPadding = null;
62 private Vector3 internalSizeModeFactor = null;
63 private Vector2 internalCellIndex = null;
64 private Color internalBackgroundColor = null;
65 private Color internalColor = null;
66 private Position internalPivotPoint = null;
67 private Position internalPosition = null;
68 private Position2D internalPosition2D = null;
69 private Vector3 internalScale = null;
70 private Size internalSize = null;
71 private Size2D internalSize2D = null;
72 private int layoutCount = 0;
73 private ControlState propagatableControlStates = ControlState.All;
75 private string internalName = string.Empty;
76 private Position internalCurrentParentOrigin = null;
77 private Position internalCurrentAnchorPoint = null;
78 private Vector3 internalTargetSize = null;
79 private Size2D internalCurrentSize = null;
80 private Position internalCurrentPosition = null;
81 private Vector3 internalCurrentWorldPosition = null;
82 private Vector3 internalCurrentScale = null;
83 private Vector3 internalCurrentWorldScale = null;
84 private Vector4 internalCurrentColor = null;
85 private Vector4 internalCurrentWorldColor = null;
86 private Vector2 internalCurrentScreenPosition = null;
88 private static int aliveCount = 0;
92 #if REMOVE_READONLY_FOR_BINDABLE_PROPERTY
93 //to get "IsUsingXaml" feature working at preload, we need to remove readonly for BindableProperty.
95 if (NUIApplication.IsUsingXaml)
97 StyleNameProperty = BindableProperty.Create(nameof(StyleName), typeof(string), typeof(View), string.Empty,
98 propertyChanged: SetInternalStyleNameProperty, defaultValueCreator: GetInternalStyleNameProperty);
100 KeyInputFocusProperty = BindableProperty.Create(nameof(KeyInputFocus), typeof(bool), typeof(View), false,
101 propertyChanged: SetInternalKeyInputFocusProperty, defaultValueCreator: GetInternalKeyInputFocusProperty);
103 BackgroundColorProperty = BindableProperty.Create(nameof(BackgroundColor), typeof(Color), typeof(View), null,
104 propertyChanged: SetInternalBackgroundColorProperty, defaultValueCreator: GetInternalBackgroundColorProperty);
106 ColorProperty = BindableProperty.Create(nameof(Color), typeof(Color), typeof(View), null,
107 propertyChanged: SetInternalColorProperty, defaultValueCreator: GetInternalColorProperty);
109 ColorRedProperty = BindableProperty.Create(nameof(ColorRed), typeof(float), typeof(View), default(float),
110 propertyChanged: SetInternalColorRedProperty, defaultValueCreator: GetInternalColorRedProperty);
112 ColorGreenProperty = BindableProperty.Create(nameof(ColorGreen), typeof(float), typeof(View), default(float),
113 propertyChanged: SetInternalColorGreenProperty, defaultValueCreator: GetInternalColorGreenProperty);
115 ColorBlueProperty = BindableProperty.Create(nameof(ColorBlue), typeof(float), typeof(View), default(float),
116 propertyChanged: SetInternalColorBlueProperty, defaultValueCreator: GetInternalColorBlueProperty);
118 BackgroundImageProperty = BindableProperty.Create(nameof(BackgroundImage), typeof(string), typeof(View), default(string),
119 propertyChanged: SetInternalBackgroundImageProperty, defaultValueCreator: GetInternalBackgroundImageProperty);
121 BackgroundImageBorderProperty = BindableProperty.Create(nameof(BackgroundImageBorder), typeof(Rectangle), typeof(View), default(Rectangle),
122 propertyChanged: SetInternalBackgroundImageBorderProperty, defaultValueCreator: GetInternalBackgroundImageBorderProperty);
124 BackgroundProperty = BindableProperty.Create(nameof(Background), typeof(PropertyMap), typeof(View), null,
125 propertyChanged: SetInternalBackgroundProperty, defaultValueCreator: GetInternalBackgroundProperty);
127 StateProperty = BindableProperty.Create(nameof(State), typeof(States), typeof(View), States.Normal,
128 propertyChanged: SetInternalStateProperty, defaultValueCreator: GetInternalStateProperty);
130 SubStateProperty = BindableProperty.Create(nameof(SubState), typeof(States), typeof(View), States.Normal,
131 propertyChanged: SetInternalSubStateProperty, defaultValueCreator: GetInternalSubStateProperty);
133 TooltipProperty = BindableProperty.Create(nameof(Tooltip), typeof(PropertyMap), typeof(View), null,
134 propertyChanged: SetInternalTooltipProperty, defaultValueCreator: GetInternalTooltipProperty);
136 FlexProperty = BindableProperty.Create(nameof(Flex), typeof(float), typeof(View), default(float),
137 propertyChanged: SetInternalFlexProperty, defaultValueCreator: GetInternalFlexProperty);
139 AlignSelfProperty = BindableProperty.Create(nameof(AlignSelf), typeof(int), typeof(View), default(int),
140 propertyChanged: SetInternalAlignSelfProperty, defaultValueCreator: GetInternalAlignSelfProperty);
142 FlexMarginProperty = BindableProperty.Create(nameof(FlexMargin), typeof(Vector4), typeof(View), null,
143 propertyChanged: SetInternalFlexMarginProperty, defaultValueCreator: GetInternalFlexMarginProperty);
145 CellIndexProperty = BindableProperty.Create(nameof(CellIndex), typeof(Vector2), typeof(View), null,
146 propertyChanged: SetInternalCellIndexProperty, defaultValueCreator: GetInternalCellIndexProperty);
148 RowSpanProperty = BindableProperty.Create(nameof(RowSpan), typeof(float), typeof(View), default(float),
149 propertyChanged: SetInternalRowSpanProperty, defaultValueCreator: GetInternalRowSpanProperty);
151 ColumnSpanProperty = BindableProperty.Create(nameof(ColumnSpan), typeof(float), typeof(View), default(float),
152 propertyChanged: SetInternalColumnSpanProperty, defaultValueCreator: GetInternalColumnSpanProperty);
154 CellHorizontalAlignmentProperty = BindableProperty.Create(nameof(CellHorizontalAlignment), typeof(HorizontalAlignmentType), typeof(View), HorizontalAlignmentType.Left,
155 propertyChanged: SetInternalCellHorizontalAlignmentProperty, defaultValueCreator: GetInternalCellHorizontalAlignmentProperty);
157 CellVerticalAlignmentProperty = BindableProperty.Create(nameof(CellVerticalAlignment), typeof(VerticalAlignmentType), typeof(View), VerticalAlignmentType.Top,
158 propertyChanged: SetInternalCellVerticalAlignmentProperty, defaultValueCreator: GetInternalCellVerticalAlignmentProperty);
160 WeightProperty = BindableProperty.Create(nameof(Weight), typeof(float), typeof(View), default(float),
161 propertyChanged: SetInternalWeightProperty, defaultValueCreator: GetInternalWeightProperty);
163 LeftFocusableViewProperty = BindableProperty.Create(nameof(View.LeftFocusableView), typeof(View), typeof(View), null,
164 propertyChanged: SetInternalLeftFocusableViewProperty, defaultValueCreator: GetInternalLeftFocusableViewProperty);
166 RightFocusableViewProperty = BindableProperty.Create(nameof(View.RightFocusableView), typeof(View), typeof(View), null,
167 propertyChanged: SetInternalRightFocusableViewProperty, defaultValueCreator: GetInternalRightFocusableViewProperty);
169 UpFocusableViewProperty = BindableProperty.Create(nameof(View.UpFocusableView), typeof(View), typeof(View), null,
170 propertyChanged: SetInternalUpFocusableViewProperty, defaultValueCreator: GetInternalUpFocusableViewProperty);
172 DownFocusableViewProperty = BindableProperty.Create(nameof(View.DownFocusableView), typeof(View), typeof(View), null,
173 propertyChanged: SetInternalDownFocusableViewProperty, defaultValueCreator: GetInternalDownFocusableViewProperty);
175 ClockwiseFocusableViewProperty = BindableProperty.Create(nameof(View.ClockwiseFocusableView), typeof(View), typeof(View), null,
176 propertyChanged: SetInternalClockwiseFocusableViewProperty, defaultValueCreator: GetInternalClockwiseFocusableViewProperty);
178 CounterClockwiseFocusableViewProperty = BindableProperty.Create(nameof(View.CounterClockwiseFocusableView), typeof(View), typeof(View), null,
179 propertyChanged: SetInternalCounterClockwiseFocusableViewProperty, defaultValueCreator: GetInternalCounterClockwiseFocusableViewProperty);
181 FocusableProperty = BindableProperty.Create(nameof(Focusable), typeof(bool), typeof(View), false,
182 propertyChanged: SetInternalFocusableProperty, defaultValueCreator: GetInternalFocusableProperty);
184 FocusableChildrenProperty = BindableProperty.Create(nameof(FocusableChildren), typeof(bool), typeof(View), true,
185 propertyChanged: SetInternalFocusableChildrenProperty, defaultValueCreator: GetInternalFocusableChildrenProperty);
187 FocusableInTouchProperty = BindableProperty.Create(nameof(FocusableInTouch), typeof(bool), typeof(View), false,
188 propertyChanged: SetInternalFocusableInTouchProperty, defaultValueCreator: GetInternalFocusableInTouchProperty);
190 Size2DProperty = BindableProperty.Create(nameof(Size2D), typeof(Size2D), typeof(View), null,
191 propertyChanged: SetInternalSize2DProperty, defaultValueCreator: GetInternalSize2DProperty);
193 OpacityProperty = BindableProperty.Create(nameof(Opacity), typeof(float), typeof(View), default(float),
194 propertyChanged: SetInternalOpacityProperty, defaultValueCreator: GetInternalOpacityProperty);
196 Position2DProperty = BindableProperty.Create(nameof(Position2D), typeof(Position2D), typeof(View), null,
197 propertyChanged: SetInternalPosition2DProperty, defaultValueCreator: GetInternalPosition2DProperty);
199 PositionUsesPivotPointProperty = BindableProperty.Create(nameof(PositionUsesPivotPoint), typeof(bool), typeof(View), true,
200 propertyChanged: SetInternalPositionUsesPivotPointProperty, defaultValueCreator: GetInternalPositionUsesPivotPointProperty);
202 SiblingOrderProperty = BindableProperty.Create(nameof(SiblingOrder), typeof(int), typeof(View), default(int),
203 propertyChanged: SetInternalSiblingOrderProperty, defaultValueCreator: GetInternalSiblingOrderProperty);
205 ParentOriginProperty = BindableProperty.Create(nameof(ParentOrigin), typeof(Position), typeof(View), null,
206 propertyChanged: SetInternalParentOriginProperty, defaultValueCreator: GetInternalParentOriginProperty);
208 PivotPointProperty = BindableProperty.Create(nameof(PivotPoint), typeof(Position), typeof(View), null,
209 propertyChanged: SetInternalPivotPointProperty, defaultValueCreator: GetInternalPivotPointProperty);
211 SizeWidthProperty = BindableProperty.Create(nameof(SizeWidth), typeof(float), typeof(View), default(float),
212 propertyChanged: SetInternalSizeWidthProperty, defaultValueCreator: GetInternalSizeWidthProperty);
214 SizeHeightProperty = BindableProperty.Create(nameof(SizeHeight), typeof(float), typeof(View), default(float),
215 propertyChanged: SetInternalSizeHeightProperty, defaultValueCreator: GetInternalSizeHeightProperty);
217 PositionProperty = BindableProperty.Create(nameof(Position), typeof(Position), typeof(View), null,
218 propertyChanged: SetInternalPositionProperty, defaultValueCreator: GetInternalPositionProperty);
220 PositionXProperty = BindableProperty.Create(nameof(PositionX), typeof(float), typeof(View), default(float),
221 propertyChanged: SetInternalPositionXProperty, defaultValueCreator: GetInternalPositionXProperty);
223 PositionYProperty = BindableProperty.Create(nameof(PositionY), typeof(float), typeof(View), default(float),
224 propertyChanged: SetInternalPositionYProperty, defaultValueCreator: GetInternalPositionYProperty);
226 PositionZProperty = BindableProperty.Create(nameof(PositionZ), typeof(float), typeof(View), default(float),
227 propertyChanged: SetInternalPositionZProperty, defaultValueCreator: GetInternalPositionZProperty);
229 OrientationProperty = BindableProperty.Create(nameof(Orientation), typeof(Rotation), typeof(View), null,
230 propertyChanged: SetInternalOrientationProperty, defaultValueCreator: GetInternalOrientationProperty);
232 ScaleProperty = BindableProperty.Create(nameof(Scale), typeof(Vector3), typeof(View), null,
233 propertyChanged: SetInternalScaleProperty, defaultValueCreator: GetInternalScaleProperty);
235 ScaleXProperty = BindableProperty.Create(nameof(ScaleX), typeof(float), typeof(View), default(float),
236 propertyChanged: SetInternalScaleXProperty, defaultValueCreator: GetInternalScaleXProperty);
238 ScaleYProperty = BindableProperty.Create(nameof(ScaleY), typeof(float), typeof(View), default(float),
239 propertyChanged: SetInternalScaleYProperty, defaultValueCreator: GetInternalScaleYProperty);
241 ScaleZProperty = BindableProperty.Create(nameof(ScaleZ), typeof(float), typeof(View), default(float),
242 propertyChanged: SetInternalScaleZProperty, defaultValueCreator: GetInternalScaleZProperty);
244 NameProperty = BindableProperty.Create(nameof(Name), typeof(string), typeof(View), string.Empty,
245 propertyChanged: SetInternalNameProperty, defaultValueCreator: GetInternalNameProperty);
247 SensitiveProperty = BindableProperty.Create(nameof(Sensitive), typeof(bool), typeof(View), false,
248 propertyChanged: SetInternalSensitiveProperty, defaultValueCreator: GetInternalSensitiveProperty);
250 IsEnabledProperty = BindableProperty.Create(nameof(IsEnabled), typeof(bool), typeof(View), false,
251 propertyChanged: SetInternalIsEnabledProperty, defaultValueCreator: GetInternalIsEnabledProperty);
253 DispatchKeyEventsProperty = BindableProperty.Create(nameof(DispatchKeyEvents), typeof(bool), typeof(View), false,
254 propertyChanged: SetInternalDispatchKeyEventsProperty, defaultValueCreator: GetInternalDispatchKeyEventsProperty);
256 LeaveRequiredProperty = BindableProperty.Create(nameof(LeaveRequired), typeof(bool), typeof(View), false,
257 propertyChanged: SetInternalLeaveRequiredProperty, defaultValueCreator: GetInternalLeaveRequiredProperty);
259 InheritOrientationProperty = BindableProperty.Create(nameof(InheritOrientation), typeof(bool), typeof(View), false,
260 propertyChanged: SetInternalInheritOrientationProperty, defaultValueCreator: GetInternalInheritOrientationProperty);
262 InheritScaleProperty = BindableProperty.Create(nameof(InheritScale), typeof(bool), typeof(View), false,
263 propertyChanged: SetInternalInheritScaleProperty, defaultValueCreator: GetInternalInheritScaleProperty);
265 DrawModeProperty = BindableProperty.Create(nameof(DrawMode), typeof(DrawModeType), typeof(View), DrawModeType.Normal,
266 propertyChanged: SetInternalDrawModeProperty, defaultValueCreator: GetInternalDrawModeProperty);
268 SizeModeFactorProperty = BindableProperty.Create(nameof(SizeModeFactor), typeof(Vector3), typeof(View), null,
269 propertyChanged: SetInternalSizeModeFactorProperty, defaultValueCreator: GetInternalSizeModeFactorProperty);
271 WidthResizePolicyProperty = BindableProperty.Create(nameof(WidthResizePolicy), typeof(ResizePolicyType), typeof(View), ResizePolicyType.Fixed,
272 propertyChanged: SetInternalWidthResizePolicyProperty, defaultValueCreator: GetInternalWidthResizePolicyProperty);
274 HeightResizePolicyProperty = BindableProperty.Create(nameof(HeightResizePolicy), typeof(ResizePolicyType), typeof(View), ResizePolicyType.Fixed,
275 propertyChanged: SetInternalHeightResizePolicyProperty, defaultValueCreator: GetInternalHeightResizePolicyProperty);
277 SizeScalePolicyProperty = BindableProperty.Create(nameof(SizeScalePolicy), typeof(SizeScalePolicyType), typeof(View), SizeScalePolicyType.UseSizeSet,
278 propertyChanged: SetInternalSizeScalePolicyProperty, defaultValueCreator: GetInternalSizeScalePolicyProperty);
280 WidthForHeightProperty = BindableProperty.Create(nameof(WidthForHeight), typeof(bool), typeof(View), false,
281 propertyChanged: SetInternalWidthForHeightProperty, defaultValueCreator: GetInternalWidthForHeightProperty);
283 HeightForWidthProperty = BindableProperty.Create(nameof(HeightForWidth), typeof(bool), typeof(View), false,
284 propertyChanged: SetInternalHeightForWidthProperty, defaultValueCreator: GetInternalHeightForWidthProperty);
286 PaddingProperty = BindableProperty.Create(nameof(Padding), typeof(Extents), typeof(View), null,
287 propertyChanged: SetInternalPaddingProperty, defaultValueCreator: GetInternalPaddingProperty);
289 SizeProperty = BindableProperty.Create(nameof(Size), typeof(Size), typeof(View), null,
290 propertyChanged: SetInternalSizeProperty, defaultValueCreator: GetInternalSizeProperty);
292 MinimumSizeProperty = BindableProperty.Create(nameof(MinimumSize), typeof(Size2D), typeof(View), null,
293 propertyChanged: SetInternalMinimumSizeProperty, defaultValueCreator: GetInternalMinimumSizeProperty);
295 MaximumSizeProperty = BindableProperty.Create(nameof(MaximumSize), typeof(Size2D), typeof(View), null,
296 propertyChanged: SetInternalMaximumSizeProperty, defaultValueCreator: GetInternalMaximumSizeProperty);
298 InheritPositionProperty = BindableProperty.Create(nameof(InheritPosition), typeof(bool), typeof(View), false,
299 propertyChanged: SetInternalInheritPositionProperty, defaultValueCreator: GetInternalInheritPositionProperty);
301 ClippingModeProperty = BindableProperty.Create(nameof(ClippingMode), typeof(ClippingModeType), typeof(View), ClippingModeType.Disabled,
302 propertyChanged: SetInternalClippingModeProperty, defaultValueCreator: GetInternalClippingModeProperty);
304 InheritLayoutDirectionProperty = BindableProperty.Create(nameof(InheritLayoutDirection), typeof(bool), typeof(View), false,
305 propertyChanged: SetInternalInheritLayoutDirectionProperty, defaultValueCreator: GetInternalInheritLayoutDirectionProperty);
307 LayoutDirectionProperty = BindableProperty.Create(nameof(LayoutDirection), typeof(ViewLayoutDirectionType), typeof(View), ViewLayoutDirectionType.LTR,
308 propertyChanged: SetInternalLayoutDirectionProperty, defaultValueCreator: GetInternalLayoutDirectionProperty);
310 MarginProperty = BindableProperty.Create(nameof(Margin), typeof(Extents), typeof(View), null,
311 propertyChanged: SetInternalMarginProperty, defaultValueCreator: GetInternalMarginProperty);
313 UpdateAreaHintProperty = BindableProperty.Create(nameof(UpdateAreaHint), typeof(Vector4), typeof(View), null,
314 propertyChanged: SetInternalUpdateAreaHintProperty, defaultValueCreator: GetInternalUpdateAreaHintProperty);
316 ImageShadowProperty = BindableProperty.Create(nameof(ImageShadow), typeof(ImageShadow), typeof(View), null,
317 propertyChanged: SetInternalImageShadowProperty, defaultValueCreator: GetInternalImageShadowProperty);
319 BoxShadowProperty = BindableProperty.Create(nameof(BoxShadow), typeof(Shadow), typeof(View), null,
320 propertyChanged: SetInternalBoxShadowProperty, defaultValueCreator: GetInternalBoxShadowProperty);
322 CornerRadiusProperty = BindableProperty.Create(nameof(CornerRadius), typeof(Vector4), typeof(View), null,
323 propertyChanged: SetInternalCornerRadiusProperty, defaultValueCreator: GetInternalCornerRadiusProperty);
325 CornerRadiusPolicyProperty = BindableProperty.Create(nameof(CornerRadiusPolicy), typeof(VisualTransformPolicyType), typeof(View), VisualTransformPolicyType.Absolute,
326 propertyChanged: SetInternalCornerRadiusPolicyProperty, defaultValueCreator: GetInternalCornerRadiusPolicyProperty);
328 BorderlineWidthProperty = BindableProperty.Create(nameof(BorderlineWidth), typeof(float), typeof(View), default(float),
329 propertyChanged: SetInternalBorderlineWidthProperty, defaultValueCreator: GetInternalBorderlineWidthProperty);
331 BorderlineColorProperty = BindableProperty.Create(nameof(BorderlineColor), typeof(Color), typeof(View), null,
332 propertyChanged: SetInternalBorderlineColorProperty, defaultValueCreator: GetInternalBorderlineColorProperty);
334 BorderlineColorSelectorProperty = BindableProperty.Create(nameof(BorderlineColorSelector), typeof(Selector<Color>), typeof(View), null,
335 propertyChanged: SetInternalBorderlineColorSelectorProperty, defaultValueCreator: GetInternalBorderlineColorSelectorProperty);
337 BorderlineOffsetProperty = BindableProperty.Create(nameof(BorderlineOffset), typeof(float), typeof(View), default(float),
338 propertyChanged: SetInternalBorderlineOffsetProperty, defaultValueCreator: GetInternalBorderlineOffsetProperty);
340 EnableControlStateProperty = BindableProperty.Create(nameof(EnableControlState), typeof(bool), typeof(View), false,
341 propertyChanged: SetInternalEnableControlStateProperty, defaultValueCreator: GetInternalEnableControlStateProperty);
343 ThemeChangeSensitiveProperty = BindableProperty.Create(nameof(ThemeChangeSensitive), typeof(bool), typeof(View), false,
344 propertyChanged: SetInternalThemeChangeSensitiveProperty, defaultValueCreator: GetInternalThemeChangeSensitiveProperty);
346 AccessibilityNameProperty = BindableProperty.Create(nameof(AccessibilityName), typeof(string), typeof(View), string.Empty,
347 propertyChanged: SetInternalAccessibilityNameProperty, defaultValueCreator: GetInternalAccessibilityNameProperty);
349 AccessibilityDescriptionProperty = BindableProperty.Create(nameof(AccessibilityDescription), typeof(string), typeof(View), string.Empty,
350 propertyChanged: SetInternalAccessibilityDescriptionProperty, defaultValueCreator: GetInternalAccessibilityDescriptionProperty);
352 AccessibilityTranslationDomainProperty = BindableProperty.Create(nameof(AccessibilityTranslationDomain), typeof(string), typeof(View), string.Empty,
353 propertyChanged: SetInternalAccessibilityTranslationDomainProperty, defaultValueCreator: GetInternalAccessibilityTranslationDomainProperty);
355 AccessibilityRoleProperty = BindableProperty.Create(nameof(AccessibilityRole), typeof(Role), typeof(View), default(Role),
356 propertyChanged: SetInternalAccessibilityRoleProperty, defaultValueCreator: GetInternalAccessibilityRoleProperty);
358 AccessibilityHighlightableProperty = BindableProperty.Create(nameof(AccessibilityHighlightable), typeof(bool), typeof(View), false,
359 propertyChanged: SetInternalAccessibilityHighlightableProperty, defaultValueCreator: GetInternalAccessibilityHighlightableProperty);
361 AccessibilityHiddenProperty = BindableProperty.Create(nameof(AccessibilityHidden), typeof(bool), typeof(View), false,
362 propertyChanged: SetInternalAccessibilityHiddenProperty, defaultValueCreator: GetInternalAccessibilityHiddenProperty);
364 ExcludeLayoutingProperty = BindableProperty.Create(nameof(ExcludeLayouting), typeof(bool), typeof(View), false,
365 propertyChanged: SetInternalExcludeLayoutingProperty, defaultValueCreator: GetInternalExcludeLayoutingProperty);
367 TooltipTextProperty = BindableProperty.Create(nameof(TooltipText), typeof(string), typeof(View), string.Empty,
368 propertyChanged: SetInternalTooltipTextProperty, defaultValueCreator: GetInternalTooltipTextProperty);
370 PositionUsesAnchorPointProperty = BindableProperty.Create(nameof(PositionUsesAnchorPoint), typeof(bool), typeof(View), false,
371 propertyChanged: SetInternalPositionUsesAnchorPointProperty, defaultValueCreator: GetInternalPositionUsesAnchorPointProperty);
373 AnchorPointProperty = BindableProperty.Create(nameof(AnchorPoint), typeof(Tizen.NUI.Position), typeof(View), null,
374 propertyChanged: SetInternalAnchorPointProperty, defaultValueCreator: GetInternalAnchorPointProperty);
376 WidthSpecificationProperty = BindableProperty.Create(nameof(WidthSpecification), typeof(int), typeof(View), 0,
377 propertyChanged: SetInternalWidthSpecificationProperty, defaultValueCreator: GetInternalWidthSpecificationProperty);
379 HeightSpecificationProperty = BindableProperty.Create(nameof(HeightSpecification), typeof(int), typeof(View), 0,
380 propertyChanged: SetInternalHeightSpecificationProperty, defaultValueCreator: GetInternalHeightSpecificationProperty);
382 LayoutTransitionProperty = BindableProperty.Create(nameof(LayoutTransition), typeof(Tizen.NUI.LayoutTransition), typeof(View), null,
383 propertyChanged: SetInternalLayoutTransitionProperty, defaultValueCreator: GetInternalLayoutTransitionProperty);
385 PaddingEXProperty = BindableProperty.Create(nameof(PaddingEX), typeof(Tizen.NUI.Extents), typeof(View), null,
386 propertyChanged: SetInternalPaddingEXProperty, defaultValueCreator: GetInternalPaddingEXProperty);
388 LayoutProperty = BindableProperty.Create(nameof(Layout), typeof(Tizen.NUI.LayoutItem), typeof(View), null,
389 propertyChanged: SetInternalLayoutProperty, defaultValueCreator: GetInternalLayoutProperty);
391 BackgroundImageSynchronosLoadingProperty = BindableProperty.Create(nameof(BackgroundImageSynchronosLoading), typeof(bool), typeof(View), false,
392 propertyChanged: SetInternalBackgroundImageSynchronosLoadingProperty, defaultValueCreator: GetInternalBackgroundImageSynchronosLoadingProperty);
394 BackgroundImageSynchronousLoadingProperty = BindableProperty.Create(nameof(BackgroundImageSynchronousLoading), typeof(bool), typeof(View), false,
395 propertyChanged: SetInternalBackgroundImageSynchronousLoadingProperty, defaultValueCreator: GetInternalBackgroundImageSynchronousLoadingProperty);
397 EnableControlStatePropagationProperty = BindableProperty.Create(nameof(EnableControlStatePropagation), typeof(bool), typeof(View), false,
398 propertyChanged: SetInternalEnableControlStatePropagationProperty, defaultValueCreator: GetInternalEnableControlStatePropagationProperty);
400 PropagatableControlStatesProperty = BindableProperty.Create(nameof(PropagatableControlStates), typeof(ControlState), typeof(View), ControlState.All,
401 propertyChanged: SetInternalPropagatableControlStatesProperty, defaultValueCreator: GetInternalPropagatableControlStatesProperty);
403 GrabTouchAfterLeaveProperty = BindableProperty.Create(nameof(GrabTouchAfterLeave), typeof(bool), typeof(View), false,
404 propertyChanged: SetInternalGrabTouchAfterLeaveProperty, defaultValueCreator: GetInternalGrabTouchAfterLeaveProperty);
406 AllowOnlyOwnTouchProperty = BindableProperty.Create(nameof(AllowOnlyOwnTouch), typeof(bool), typeof(View), false,
407 propertyChanged: SetInternalAllowOnlyOwnTouchProperty, defaultValueCreator: GetInternalAllowOnlyOwnTouchProperty);
409 BlendEquationProperty = BindableProperty.Create(nameof(BlendEquation), typeof(BlendEquationType), typeof(View), default(BlendEquationType),
410 propertyChanged: SetInternalBlendEquationProperty, defaultValueCreator: GetInternalBlendEquationProperty);
412 TransitionOptionsProperty = BindableProperty.Create(nameof(TransitionOptions), typeof(TransitionOptions), typeof(View), default(TransitionOptions),
413 propertyChanged: SetInternalTransitionOptionsProperty, defaultValueCreator: GetInternalTransitionOptionsProperty);
415 AutomationIdProperty = BindableProperty.Create(nameof(AutomationId), typeof(string), typeof(View), string.Empty,
416 propertyChanged: SetInternalAutomationIdProperty, defaultValueCreator: GetInternalAutomationIdProperty);
418 TouchAreaOffsetProperty = BindableProperty.Create(nameof(TouchAreaOffset), typeof(Offset), typeof(View), default(Offset),
419 propertyChanged: SetInternalTouchAreaOffsetProperty, defaultValueCreator: GetInternalTouchAreaOffsetProperty);
421 DispatchTouchMotionProperty = BindableProperty.Create(nameof(DispatchTouchMotion), typeof(bool), typeof(View), false,
422 propertyChanged: SetInternalDispatchTouchMotionProperty, defaultValueCreator: GetInternalDispatchTouchMotionProperty);
424 DispatchHoverMotionProperty = BindableProperty.Create(nameof(DispatchHoverMotion), typeof(bool), typeof(View), false,
425 propertyChanged: SetInternalDispatchHoverMotionProperty, defaultValueCreator: GetInternalDispatchHoverMotionProperty);
427 RegisterPropertyGroup(PositionProperty, positionPropertyGroup);
428 RegisterPropertyGroup(Position2DProperty, positionPropertyGroup);
429 RegisterPropertyGroup(PositionXProperty, positionPropertyGroup);
430 RegisterPropertyGroup(PositionYProperty, positionPropertyGroup);
432 RegisterPropertyGroup(SizeProperty, sizePropertyGroup);
433 RegisterPropertyGroup(Size2DProperty, sizePropertyGroup);
434 RegisterPropertyGroup(SizeWidthProperty, sizePropertyGroup);
435 RegisterPropertyGroup(SizeHeightProperty, sizePropertyGroup);
437 RegisterPropertyGroup(ScaleProperty, scalePropertyGroup);
438 RegisterPropertyGroup(ScaleXProperty, scalePropertyGroup);
439 RegisterPropertyGroup(ScaleYProperty, scalePropertyGroup);
440 RegisterPropertyGroup(ScaleZProperty, scalePropertyGroup);
445 static internal new void Preload()
449 // not needed, at preload, APP can not set the "IsUsingXaml" flag, it have the default value at preload
450 // if (NUIApplication.IsUsingXaml)
452 // // Do nothing. Just call for load static values.
453 // var temporalPositionPropertyGroup = positionPropertyGroup;
454 // var temporalSizePropertyGroup = sizePropertyGroup;
455 // var temporalScalePropertyGroup = scalePropertyGroup;
460 /// Accessibility mode for controlling View's Accessible implementation.
461 /// It is only relevant when deriving custom controls from View directly,
462 /// as classes derived from CustomView (or any of its subclasses) get the
463 /// Custom mode by default.
465 [EditorBrowsable(EditorBrowsableState.Never)]
466 public enum ViewAccessibilityMode
469 /// Default accessibility implementation. Overriding View.Accessibility...()
470 /// virtual methods will have no effect.
472 [EditorBrowsable(EditorBrowsableState.Never)]
475 /// Custom accessibility implementation. Overriding View.Accessibility...()
476 /// will be necessary to provide accessibility support for the View.
478 [EditorBrowsable(EditorBrowsableState.Never)]
482 private static IntPtr NewWithAccessibilityMode(ViewAccessibilityMode accessibilityMode)
484 switch (accessibilityMode)
486 case ViewAccessibilityMode.Custom:
488 return Interop.View.NewCustom();
490 case ViewAccessibilityMode.Default:
493 return Interop.View.New();
499 /// Creates a new instance of a view.
501 /// <since_tizen> 3 </since_tizen>
502 public View() : this(ViewAccessibilityMode.Default)
506 [EditorBrowsable(EditorBrowsableState.Never)]
507 public View(ViewAccessibilityMode accessibilityMode) : this(NewWithAccessibilityMode(accessibilityMode), true)
509 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
512 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
513 [EditorBrowsable(EditorBrowsableState.Never)]
514 public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
519 /// Create a new instance of a View with setting the status of shown or hidden.
521 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
522 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
523 [EditorBrowsable(EditorBrowsableState.Never)]
524 public View(bool shown) : this(Interop.View.New(), true)
526 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
530 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
532 InitializeStyle(viewStyle);
535 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : this(cPtr, cMemoryOwn, shown, cMemoryOwn)
539 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown, bool cRegister) : base(cPtr, cMemoryOwn, cRegister)
543 PositionUsesPivotPoint = false;
544 GrabTouchAfterLeave = defaultGrabTouchAfterLeave;
545 AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch;
556 internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
558 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
567 /// The event that is triggered when the View's ControlState is changed.
569 [EditorBrowsable(EditorBrowsableState.Never)]
570 public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
572 internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
576 /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
578 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
579 [EditorBrowsable(EditorBrowsableState.Never)]
580 public bool LayoutSet
589 /// Flag to allow Layouting to be disabled for Views.
590 /// Once a View has a Layout set then any children added to Views from then on will receive
591 /// automatic Layouts.
593 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
594 [EditorBrowsable(EditorBrowsableState.Never)]
595 public static bool LayoutingDisabled { get; set; } = true;
598 /// If set to true, the <see cref="GrabTouchAfterLeave"/> property value is set to true when all Views are created.
600 /// <param name="enable">Sets value of GrabTouchAfterLeave property</param>
601 [EditorBrowsable(EditorBrowsableState.Never)]
602 public static void SetDefaultGrabTouchAfterLeave(bool enable)
604 defaultGrabTouchAfterLeave = enable;
608 /// If set to true, the <see cref="AllowOnlyOwnTouch"/> property value is set to true when all Views are created.
610 /// <param name="enable">Sets value of AllowOnlyOwnTouch property</param>
611 [EditorBrowsable(EditorBrowsableState.Never)]
612 public static void SetDefaultAllowOnlyOwnTouch(bool enable)
614 defaultAllowOnlyOwnTouch = enable;
618 /// Deprecate. Do not use this.
619 /// The style instance applied to this view.
620 /// Note that do not modify the ViewStyle.
621 /// Modifying ViewStyle will affect other views with same ViewStyle.
623 [EditorBrowsable(EditorBrowsableState.Never)]
624 protected ViewStyle ViewStyle
628 if (themeData == null) themeData = new ThemeData();
630 if (themeData.viewStyle == null)
632 ApplyStyle(CreateViewStyle());
634 return themeData.viewStyle;
639 /// Get/Set the control state.
640 /// Note that the ControlState only available for the classes derived from Control.
641 /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
642 /// please set <see cref="EnableControlState"/> to true.
644 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
645 [EditorBrowsable(EditorBrowsableState.Never)]
646 public ControlState ControlState
650 return themeData == null ? ControlState.Normal : themeData.controlStates;
654 if (ControlState == value)
659 var prevState = ControlState;
661 if (themeData == null) themeData = new ThemeData();
662 themeData.controlStates = value;
664 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
666 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
668 if (themeData.ControlStatePropagation)
670 foreach (View child in Children)
672 ControlState allowed = child.PropagatableControlStates;
673 if (allowed.Contains(ControlState.All))
675 child.ControlState = value;
679 ControlState newControlState = child.ControlState;
681 if (allowed.Contains(ControlState.Normal))
683 if (value.Contains(ControlState.Normal))
685 newControlState += ControlState.Normal;
689 newControlState -= ControlState.Normal;
693 if (allowed.Contains(ControlState.Disabled))
695 if (value.Contains(ControlState.Disabled))
697 newControlState += ControlState.Disabled;
701 newControlState -= ControlState.Disabled;
705 if (allowed.Contains(ControlState.Selected))
707 if (value.Contains(ControlState.Selected))
709 newControlState += ControlState.Selected;
713 newControlState -= ControlState.Selected;
717 if (allowed.Contains(ControlState.Pressed))
719 if (value.Contains(ControlState.Pressed))
721 newControlState += ControlState.Pressed;
725 newControlState -= ControlState.Pressed;
729 if (allowed.Contains(ControlState.Focused))
731 if (value.Contains(ControlState.Focused))
733 newControlState += ControlState.Focused;
737 newControlState -= ControlState.Focused;
741 if (allowed.Contains(ControlState.Other))
743 if (value.Contains(ControlState.Other))
745 newControlState += ControlState.Other;
749 newControlState -= ControlState.Other;
753 if (child.ControlState != newControlState)
754 child.ControlState = newControlState;
759 OnControlStateChanged(changeInfo);
761 ControlStateChangedEvent?.Invoke(this, changeInfo);
766 /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
768 /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
769 [EditorBrowsable(EditorBrowsableState.Never)]
770 public bool ExcludeLayouting
774 if (NUIApplication.IsUsingXaml)
776 return (bool)GetValue(ExcludeLayoutingProperty);
780 return (bool)GetInternalExcludeLayoutingProperty(this);
785 if (NUIApplication.IsUsingXaml)
787 SetValue(ExcludeLayoutingProperty, value);
791 SetInternalExcludeLayoutingProperty(this, null, value);
793 NotifyPropertyChanged();
797 private bool InternalExcludeLayouting
801 return excludeLayouting;
805 excludeLayouting = value;
806 if (Layout != null && Layout.SetPositionByLayout == value)
808 Layout.SetPositionByLayout = !value;
809 Layout.RequestLayout();
815 /// The StyleName, type string.
816 /// The value indicates DALi style name defined in json theme file.
818 /// <since_tizen> 3 </since_tizen>
819 public string StyleName
823 if (NUIApplication.IsUsingXaml)
825 return (string)GetValue(StyleNameProperty);
829 return (string)GetInternalStyleNameProperty(this);
834 if (NUIApplication.IsUsingXaml)
836 SetValue(StyleNameProperty, value);
840 SetInternalStyleNameProperty(this, null, value);
842 NotifyPropertyChanged();
847 /// The KeyInputFocus, type bool.
849 [EditorBrowsable(EditorBrowsableState.Never)]
850 public bool KeyInputFocus
854 if (NUIApplication.IsUsingXaml)
856 return (bool)GetValue(KeyInputFocusProperty);
860 return (bool)GetInternalKeyInputFocusProperty(this);
865 if (NUIApplication.IsUsingXaml)
867 SetValue(KeyInputFocusProperty, value);
871 SetInternalKeyInputFocusProperty(this, null, value);
873 NotifyPropertyChanged();
878 /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
882 /// The property cascade chaining set is not recommended.
885 /// Animatable - This property can be animated using <c>Animation</c> class.
887 /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
892 /// This way is recommended for setting the property
894 /// var view = new View();
895 /// view.BackgroundColor = new Color(0.5f, 0.1f, 0, 1);
897 /// This way to set the property is prohibited
899 /// view.BackgroundColor.R = 0.5f; //This does not guarantee a proper operation
902 /// <since_tizen> 3 </since_tizen>
903 public Color BackgroundColor
907 if (NUIApplication.IsUsingXaml)
909 return (Color)GetValue(BackgroundColorProperty);
913 return (Color)GetInternalBackgroundColorProperty(this);
918 if (NUIApplication.IsUsingXaml)
920 SetValue(BackgroundColorProperty, value);
924 SetInternalBackgroundColorProperty(this, null, value);
926 NotifyPropertyChanged();
931 /// The mutually exclusive with "backgroundColor" and "background" type Map.
933 /// <since_tizen> 3 </since_tizen>
934 public string BackgroundImage
938 if (NUIApplication.IsUsingXaml)
940 return (string)GetValue(BackgroundImageProperty);
944 return (string)GetInternalBackgroundImageProperty(this);
949 if (NUIApplication.IsUsingXaml)
951 SetValue(BackgroundImageProperty, value);
955 SetInternalBackgroundImageProperty(this, null, value);
957 NotifyPropertyChanged();
962 /// Get or set the border of background image.
964 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
965 [EditorBrowsable(EditorBrowsableState.Never)]
966 public Rectangle BackgroundImageBorder
970 if (NUIApplication.IsUsingXaml)
972 return (Rectangle)GetValue(BackgroundImageBorderProperty);
976 return (Rectangle)GetInternalBackgroundImageBorderProperty(this);
981 if (NUIApplication.IsUsingXaml)
983 SetValue(BackgroundImageBorderProperty, value);
987 SetInternalBackgroundImageBorderProperty(this, null, value);
989 NotifyPropertyChanged();
994 /// The background of view.
996 /// <since_tizen> 3 </since_tizen>
997 public Tizen.NUI.PropertyMap Background
1001 if (NUIApplication.IsUsingXaml)
1003 return (PropertyMap)GetValue(BackgroundProperty);
1007 return (PropertyMap)GetInternalBackgroundProperty(this);
1012 if (NUIApplication.IsUsingXaml)
1014 SetValue(BackgroundProperty, value);
1018 SetInternalBackgroundProperty(this, null, value);
1020 NotifyPropertyChanged();
1025 /// Describes a shadow as an image for a View.
1026 /// It is null by default.
1029 /// Getter returns copied instance of current shadow.
1032 /// The mutually exclusive with "BoxShadow".
1036 /// Animatable - This property can be animated using <c>Animation</c> class.
1037 /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
1039 /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
1041 /// Animatable sub-property : Offset.
1044 [EditorBrowsable(EditorBrowsableState.Never)]
1045 public ImageShadow ImageShadow
1049 if (NUIApplication.IsUsingXaml)
1051 return (ImageShadow)GetValue(ImageShadowProperty);
1055 return (ImageShadow)GetInternalImageShadowProperty(this);
1060 if (NUIApplication.IsUsingXaml)
1062 SetValue(ImageShadowProperty, value);
1066 SetInternalImageShadowProperty(this, null, value);
1068 NotifyPropertyChanged();
1073 /// Describes a box shaped shadow drawing for a View.
1074 /// It is null by default.
1077 /// The mutually exclusive with "ImageShadow".
1081 /// Animatable - This property can be animated using <c>Animation</c> class.
1082 /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
1084 /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
1086 /// Animatable sub-property : Offset, Color, BlurRadius.
1089 /// <since_tizen> 9 </since_tizen>
1090 public Shadow BoxShadow
1094 if (NUIApplication.IsUsingXaml)
1096 return (Shadow)GetValue(BoxShadowProperty);
1100 return (Shadow)GetInternalBoxShadowProperty(this);
1105 if (NUIApplication.IsUsingXaml)
1107 SetValue(BoxShadowProperty, value);
1111 SetInternalBoxShadowProperty(this, null, value);
1113 NotifyPropertyChanged();
1118 /// The radius for the rounded corners of the View.
1119 /// This will rounds background and shadow edges.
1120 /// 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).
1121 /// Each radius will clamp internally to the half of smaller of the view's width or height.
1122 /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
1126 /// Animatable - This property can be animated using <c>Animation</c> class.
1128 /// animation.AnimateTo(view, "CornerRadius", new Vector4(10, 10, 10, 10));
1132 /// <since_tizen> 9 </since_tizen>
1133 public Vector4 CornerRadius
1137 if (NUIApplication.IsUsingXaml)
1139 return (Vector4)GetValue(CornerRadiusProperty);
1143 return (Vector4)GetInternalCornerRadiusProperty(this);
1148 if (NUIApplication.IsUsingXaml)
1150 SetValue(CornerRadiusProperty, value);
1154 SetInternalCornerRadiusProperty(this, null, value);
1156 NotifyPropertyChanged();
1161 /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
1162 /// It is absolute by default.
1163 /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
1165 /// <since_tizen> 9 </since_tizen>
1166 public VisualTransformPolicyType CornerRadiusPolicy
1171 if (NUIApplication.IsUsingXaml)
1173 return (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
1177 return (VisualTransformPolicyType)GetInternalCornerRadiusPolicyProperty(this);
1182 if (NUIApplication.IsUsingXaml)
1184 SetValue(CornerRadiusPolicyProperty, value);
1188 SetInternalCornerRadiusPolicyProperty(this, null, value);
1194 /// The width for the borderline of the View.
1198 /// Animatable - This property can be animated using <c>Animation</c> class.
1200 /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
1203 /// Note that, an image background may not have borderline if it uses the Border property.
1205 /// <since_tizen> 9 </since_tizen>
1206 public float BorderlineWidth
1210 if (NUIApplication.IsUsingXaml)
1212 return (float)GetValue(BorderlineWidthProperty);
1216 return (float)GetInternalBorderlineWidthProperty(this);
1221 if (NUIApplication.IsUsingXaml)
1223 SetValue(BorderlineWidthProperty, value);
1227 SetInternalBorderlineWidthProperty(this, null, value);
1229 NotifyPropertyChanged();
1234 /// The color for the borderline of the View.
1235 /// It is Color.Black by default.
1239 /// Animatable - This property can be animated using <c>Animation</c> class.
1241 /// animation.AnimateTo(view, "BorderlineColor", new Color(r, g, b, a));
1245 /// <since_tizen> 9 </since_tizen>
1246 public Color BorderlineColor
1250 if (NUIApplication.IsUsingXaml)
1252 return (Color)GetValue(BorderlineColorProperty);
1256 return (Color)GetInternalBorderlineColorProperty(this);
1261 if (NUIApplication.IsUsingXaml)
1263 SetValue(BorderlineColorProperty, value);
1267 SetInternalBorderlineColorProperty(this, null, value);
1269 NotifyPropertyChanged();
1274 /// The color selector for the borderline of the View.
1275 /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
1276 /// So this API is internally used only.
1278 internal Selector<Color> BorderlineColorSelector
1282 if (NUIApplication.IsUsingXaml)
1284 return (Selector<Color>)GetValue(BorderlineColorSelectorProperty);
1288 return (Selector<Color>)GetInternalBorderlineColorSelectorProperty(this);
1293 if (NUIApplication.IsUsingXaml)
1295 SetValue(BorderlineColorSelectorProperty, value);
1299 SetInternalBorderlineColorSelectorProperty(this, null, value);
1301 NotifyPropertyChanged();
1306 /// The Relative offset for the borderline of the View.
1307 /// Recommended range : [-1.0f to 1.0f].
1308 /// If -1.0f, draw borderline inside of the View.
1309 /// If 1.0f, draw borderline outside of the View.
1310 /// If 0.0f, draw borderline half inside and half outside.
1311 /// It is 0.0f by default.
1315 /// Animatable - This property can be animated using <c>Animation</c> class.
1317 /// animation.AnimateTo(view, "BorderlineOffset", -1.0f);
1321 /// <since_tizen> 9 </since_tizen>
1322 public float BorderlineOffset
1326 if (NUIApplication.IsUsingXaml)
1328 return (float)GetValue(BorderlineOffsetProperty);
1332 return (float)GetInternalBorderlineOffsetProperty(this);
1337 if (NUIApplication.IsUsingXaml)
1339 SetValue(BorderlineOffsetProperty, value);
1343 SetInternalBorderlineOffsetProperty(this, null, value);
1345 NotifyPropertyChanged();
1350 /// The current state of the view.
1352 /// <since_tizen> 3 </since_tizen>
1357 if (NUIApplication.IsUsingXaml)
1359 return (States)GetValue(StateProperty);
1363 return (States)GetInternalStateProperty(this);
1368 if (NUIApplication.IsUsingXaml)
1370 SetValue(StateProperty, value);
1374 SetInternalStateProperty(this, null, value);
1376 NotifyPropertyChanged();
1381 /// The current sub state of the view.
1383 /// <since_tizen> 3 </since_tizen>
1384 public States SubState
1388 if (NUIApplication.IsUsingXaml)
1390 return (States)GetValue(SubStateProperty);
1394 return (States)GetInternalSubStateProperty(this);
1399 if (NUIApplication.IsUsingXaml)
1401 SetValue(SubStateProperty, value);
1405 SetInternalSubStateProperty(this, null, value);
1407 NotifyPropertyChanged();
1412 /// Displays a tooltip
1414 /// <since_tizen> 3 </since_tizen>
1415 public Tizen.NUI.PropertyMap Tooltip
1419 if (NUIApplication.IsUsingXaml)
1421 return (PropertyMap)GetValue(TooltipProperty);
1425 return (PropertyMap)GetInternalTooltipProperty(this);
1430 if (NUIApplication.IsUsingXaml)
1432 SetValue(TooltipProperty, value);
1436 SetInternalTooltipProperty(this, null, value);
1438 NotifyPropertyChanged();
1443 /// Displays a tooltip as a text.
1445 /// <since_tizen> 3 </since_tizen>
1446 public string TooltipText
1450 if (NUIApplication.IsUsingXaml)
1452 return GetValue(TooltipTextProperty) as string;
1456 return GetInternalTooltipTextProperty(this) as string;
1461 if (NUIApplication.IsUsingXaml)
1463 SetValue(TooltipTextProperty, value);
1467 SetInternalTooltipTextProperty(this, null, value);
1472 private string InternalTooltipText
1476 using (var propertyValue = GetProperty(Property.TOOLTIP))
1478 using var propertyMap = new PropertyMap();
1479 if (propertyValue != null && propertyValue.Get(propertyMap))
1481 using var retrivedContentValue = propertyMap?.Find(NDalic.TooltipContent);
1482 if (retrivedContentValue != null)
1484 using var contextPropertyMap = new PropertyMap();
1485 if (retrivedContentValue.Get(contextPropertyMap))
1487 using var retrivedTextValue = contextPropertyMap?.Find(NDalic.TextVisualText);
1488 if (retrivedTextValue != null && retrivedTextValue.Get(out string retrivedValue))
1490 return retrivedValue;
1500 var temp = new Tizen.NUI.PropertyValue(value);
1501 SetProperty(View.Property.TOOLTIP, temp);
1503 NotifyPropertyChanged();
1508 /// The Child property of FlexContainer.<br />
1509 /// The proportion of the free space in the container, the flex item will receive.<br />
1510 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
1512 /// <since_tizen> 3 </since_tizen>
1513 [Obsolete("Deprecated in API8, will be removed in API10.")]
1518 if (NUIApplication.IsUsingXaml)
1520 return (float)GetValue(FlexProperty);
1524 return (float)GetInternalFlexProperty(this);
1529 if (NUIApplication.IsUsingXaml)
1531 SetValue(FlexProperty, value);
1535 SetInternalFlexProperty(this, null, value);
1537 NotifyPropertyChanged();
1542 /// The Child property of FlexContainer.<br />
1543 /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
1545 /// <since_tizen> 3 </since_tizen>
1546 [Obsolete("Deprecated in API8, will be removed in API10.")]
1547 public int AlignSelf
1551 if (NUIApplication.IsUsingXaml)
1553 return (int)GetValue(AlignSelfProperty);
1557 return (int)GetInternalAlignSelfProperty(this);
1562 if (NUIApplication.IsUsingXaml)
1564 SetValue(AlignSelfProperty, value);
1568 SetInternalAlignSelfProperty(this, null, value);
1570 NotifyPropertyChanged();
1575 /// The Child property of FlexContainer.<br />
1576 /// The space around the flex item.<br />
1579 /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
1581 /// <since_tizen> 3 </since_tizen>
1582 [Obsolete("Deprecated in API8, will be removed in API10.")]
1583 public Vector4 FlexMargin
1587 if (NUIApplication.IsUsingXaml)
1589 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
1590 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
1594 Vector4 temp = (Vector4)GetInternalFlexMarginProperty(this);
1595 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
1600 if (NUIApplication.IsUsingXaml)
1602 SetValue(FlexMarginProperty, value);
1606 SetInternalFlexMarginProperty(this, null, value);
1608 NotifyPropertyChanged();
1613 /// The top-left cell this child occupies, if not set, the first available cell is used.
1616 /// The property cascade chaining set is not recommended.
1617 /// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
1620 /// This way is recommended for setting the property
1622 /// var view = new View();
1623 /// view.CellIndex = new Vector2(1, 3);
1625 /// This way to set the property is prohibited
1627 /// view.CellIndex.X = 1; //This does not guarantee a proper operation
1630 /// <since_tizen> 3 </since_tizen>
1631 public Vector2 CellIndex
1635 if (NUIApplication.IsUsingXaml)
1637 return (Vector2)GetValue(CellIndexProperty);
1641 return (Vector2)GetInternalCellIndexProperty(this);
1648 if (NUIApplication.IsUsingXaml)
1650 SetValue(CellIndexProperty, value);
1654 SetInternalCellIndexProperty(this, null, value);
1658 NotifyPropertyChanged();
1663 /// The number of rows this child occupies, if not set, the default value is 1.
1666 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1668 /// <since_tizen> 3 </since_tizen>
1669 public float RowSpan
1673 if (NUIApplication.IsUsingXaml)
1675 return (float)GetValue(RowSpanProperty);
1679 return (float)GetInternalRowSpanProperty(this);
1684 if (NUIApplication.IsUsingXaml)
1686 SetValue(RowSpanProperty, value);
1690 SetInternalRowSpanProperty(this, null, value);
1692 NotifyPropertyChanged();
1697 /// The number of columns this child occupies, if not set, the default value is 1.
1700 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1702 /// <since_tizen> 3 </since_tizen>
1703 public float ColumnSpan
1707 if (NUIApplication.IsUsingXaml)
1709 return (float)GetValue(ColumnSpanProperty);
1713 return (float)GetInternalColumnSpanProperty(this);
1718 if (NUIApplication.IsUsingXaml)
1720 SetValue(ColumnSpanProperty, value);
1724 SetInternalColumnSpanProperty(this, null, value);
1726 NotifyPropertyChanged();
1731 /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
1734 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1736 /// <since_tizen> 3 </since_tizen>
1737 public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
1741 if (NUIApplication.IsUsingXaml)
1743 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
1747 return (HorizontalAlignmentType)GetInternalCellHorizontalAlignmentProperty(this);
1752 if (NUIApplication.IsUsingXaml)
1754 SetValue(CellHorizontalAlignmentProperty, value);
1758 SetInternalCellHorizontalAlignmentProperty(this, null, value);
1760 NotifyPropertyChanged();
1765 /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
1768 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1770 /// <since_tizen> 3 </since_tizen>
1771 public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
1775 if (NUIApplication.IsUsingXaml)
1777 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
1781 return (VerticalAlignmentType)GetInternalCellVerticalAlignmentProperty(this);
1786 if (NUIApplication.IsUsingXaml)
1788 SetValue(CellVerticalAlignmentProperty, value);
1792 SetInternalCellVerticalAlignmentProperty(this, null, value);
1794 NotifyPropertyChanged();
1799 /// The left focusable view.<br />
1800 /// This will return null if not set.<br />
1801 /// This will also return null if the specified left focusable view is not on a window.<br />
1803 /// <since_tizen> 3 </since_tizen>
1804 public View LeftFocusableView
1806 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1809 if (NUIApplication.IsUsingXaml)
1811 return (View)GetValue(LeftFocusableViewProperty);
1815 return (View)GetInternalLeftFocusableViewProperty(this);
1820 if (NUIApplication.IsUsingXaml)
1822 SetValue(LeftFocusableViewProperty, value);
1826 SetInternalLeftFocusableViewProperty(this, null, value);
1828 NotifyPropertyChanged();
1833 /// The right focusable view.<br />
1834 /// This will return null if not set.<br />
1835 /// This will also return null if the specified right focusable view is not on a window.<br />
1837 /// <since_tizen> 3 </since_tizen>
1838 public View RightFocusableView
1840 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1843 if (NUIApplication.IsUsingXaml)
1845 return (View)GetValue(RightFocusableViewProperty);
1849 return (View)GetInternalRightFocusableViewProperty(this);
1854 if (NUIApplication.IsUsingXaml)
1856 SetValue(RightFocusableViewProperty, value);
1860 SetInternalRightFocusableViewProperty(this, null, value);
1862 NotifyPropertyChanged();
1867 /// The up focusable view.<br />
1868 /// This will return null if not set.<br />
1869 /// This will also return null if the specified up focusable view is not on a window.<br />
1871 /// <since_tizen> 3 </since_tizen>
1872 public View UpFocusableView
1874 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1877 if (NUIApplication.IsUsingXaml)
1879 return (View)GetValue(UpFocusableViewProperty);
1883 return (View)GetInternalUpFocusableViewProperty(this);
1888 if (NUIApplication.IsUsingXaml)
1890 SetValue(UpFocusableViewProperty, value);
1894 SetInternalUpFocusableViewProperty(this, null, value);
1896 NotifyPropertyChanged();
1901 /// The down focusable view.<br />
1902 /// This will return null if not set.<br />
1903 /// This will also return null if the specified down focusable view is not on a window.<br />
1905 /// <since_tizen> 3 </since_tizen>
1906 public View DownFocusableView
1908 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1911 if (NUIApplication.IsUsingXaml)
1913 return (View)GetValue(DownFocusableViewProperty);
1917 return (View)GetInternalDownFocusableViewProperty(this);
1922 if (NUIApplication.IsUsingXaml)
1924 SetValue(DownFocusableViewProperty, value);
1928 SetInternalDownFocusableViewProperty(this, null, value);
1930 NotifyPropertyChanged();
1935 /// The clockwise focusable view by rotary wheel.<br />
1936 /// This will return null if not set.<br />
1937 /// This will also return null if the specified clockwise focusable view is not on a window.<br />
1939 [EditorBrowsable(EditorBrowsableState.Never)]
1940 public View ClockwiseFocusableView
1942 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1945 if (NUIApplication.IsUsingXaml)
1947 return (View)GetValue(ClockwiseFocusableViewProperty);
1951 return (View)GetInternalClockwiseFocusableViewProperty(this);
1956 if (NUIApplication.IsUsingXaml)
1958 SetValue(ClockwiseFocusableViewProperty, value);
1962 SetInternalClockwiseFocusableViewProperty(this, null, value);
1964 NotifyPropertyChanged();
1969 /// The counter clockwise focusable view by rotary wheel.<br />
1970 /// This will return null if not set.<br />
1971 /// This will also return null if the specified counter clockwise focusable view is not on a window.<br />
1973 [EditorBrowsable(EditorBrowsableState.Never)]
1974 public View CounterClockwiseFocusableView
1976 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1979 if (NUIApplication.IsUsingXaml)
1981 return (View)GetValue(CounterClockwiseFocusableViewProperty);
1985 return (View)GetInternalCounterClockwiseFocusableViewProperty(this);
1990 if (NUIApplication.IsUsingXaml)
1992 SetValue(CounterClockwiseFocusableViewProperty, value);
1996 SetInternalCounterClockwiseFocusableViewProperty(this, null, value);
1998 NotifyPropertyChanged();
2003 /// Whether the view should be focusable by keyboard navigation.
2005 /// <since_tizen> 3 </since_tizen>
2006 public bool Focusable
2010 if (NUIApplication.IsUsingXaml)
2012 return (bool)GetValue(FocusableProperty);
2016 return (bool)GetInternalFocusableProperty(this);
2021 if (NUIApplication.IsUsingXaml)
2023 SetValue(FocusableProperty, value);
2027 SetInternalFocusableProperty(this, null, value);
2029 NotifyPropertyChanged();
2034 /// 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.
2035 /// Note : Default value is true.
2037 [EditorBrowsable(EditorBrowsableState.Never)]
2038 public bool FocusableChildren
2042 if (NUIApplication.IsUsingXaml)
2044 return (bool)GetValue(FocusableChildrenProperty);
2048 return (bool)GetInternalFocusableChildrenProperty(this);
2053 if (NUIApplication.IsUsingXaml)
2055 SetValue(FocusableChildrenProperty, value);
2059 SetInternalFocusableChildrenProperty(this, null, value);
2061 NotifyPropertyChanged();
2066 /// Whether this view can focus by touch.
2067 /// If Focusable is false, FocusableInTouch is disabled.
2068 /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
2070 [EditorBrowsable(EditorBrowsableState.Never)]
2071 public bool FocusableInTouch
2076 if (NUIApplication.IsUsingXaml)
2078 return (bool)GetValue(FocusableInTouchProperty);
2082 return (bool)GetInternalFocusableInTouchProperty(this);
2087 if (NUIApplication.IsUsingXaml)
2089 SetValue(FocusableInTouchProperty, value);
2093 SetInternalFocusableInTouchProperty(this, null, value);
2095 NotifyPropertyChanged();
2100 /// Retrieves the position of the view.
2101 /// The coordinates are relative to the view's parent.
2104 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
2105 /// 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).
2106 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
2107 /// and users can get the current actual values through them.
2109 /// <since_tizen> 3 </since_tizen>
2110 public Position CurrentPosition
2114 return GetCurrentPosition();
2119 /// Sets the size of a view for the width and the height.<br />
2120 /// Geometry can be scaled to fit within this area.<br />
2121 /// This does not interfere with the view's scale factor.<br />
2122 /// The views default depth is the minimum of width and height.<br />
2125 /// The property cascade chaining set is not recommended.
2128 /// This way is recommended for setting the property
2130 /// var view = new View();
2131 /// view.Size2D = new Size2D(100, 200);
2133 /// This way to set the property is prohibited
2135 /// view.Size2D.Width = 100; //This does not guarantee a proper operation
2138 /// <since_tizen> 3 </since_tizen>
2139 public Size2D Size2D
2143 if (NUIApplication.IsUsingXaml)
2145 var temp = (Size2D)GetValue(Size2DProperty);
2146 if (this.Layout == null)
2148 if (temp.Width < 0) { temp.Width = 0; }
2149 if (temp.Height < 0) { temp.Height = 0; }
2155 var temp = (Size2D)GetInternalSize2DProperty(this);
2156 if (this.Layout == null)
2158 if (temp.Width < 0) { temp.Width = 0; }
2159 if (temp.Height < 0) { temp.Height = 0; }
2166 if (NUIApplication.IsUsingXaml)
2168 SetValue(Size2DProperty, value);
2172 SetInternalSize2DProperty(this, null, value);
2174 NotifyPropertyChanged();
2179 /// Retrieves the size of the view.
2180 /// The coordinates are relative to the view's parent.
2183 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
2184 /// 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).
2185 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
2186 /// and users can get the current actual values through them.
2188 /// <since_tizen> 3 </since_tizen>
2189 public Size2D CurrentSize
2193 return GetCurrentSize();
2198 /// Retrieves and sets the view's opacity.<br />
2202 /// Animatable - This property can be animated using <c>Animation</c> class.
2204 /// animation.AnimateTo(view, "Opacity", 0.5f);
2208 /// <since_tizen> 3 </since_tizen>
2209 public float Opacity
2213 if (NUIApplication.IsUsingXaml)
2215 return (float)GetValue(OpacityProperty);
2219 return (float)GetInternalOpacityProperty(this);
2224 if (NUIApplication.IsUsingXaml)
2226 SetValue(OpacityProperty, value);
2230 SetInternalOpacityProperty(this, null, value);
2232 NotifyPropertyChanged();
2237 /// Sets the position of the view for X and Y.<br />
2238 /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
2239 /// If the position inheritance is disabled, sets the world position.<br />
2242 /// The property cascade chaining set is not recommended.
2245 /// This way is recommended for setting the property
2247 /// var view = new View();
2248 /// view.Position2D = new Position2D(100, 200);
2250 /// This way to set the property is prohibited
2252 /// view.Position2D.X = 100; //This does not guarantee a proper operation
2255 /// <since_tizen> 3 </since_tizen>
2256 public Position2D Position2D
2260 if (NUIApplication.IsUsingXaml)
2262 return (Position2D)GetValue(Position2DProperty);
2266 return (Position2D)GetInternalPosition2DProperty(this);
2272 if (NUIApplication.IsUsingXaml)
2274 SetValue(Position2DProperty, value);
2278 SetInternalPosition2DProperty(this, null, value);
2281 NotifyPropertyChanged();
2286 /// Retrieves the screen position of the view.<br />
2288 /// <since_tizen> 3 </since_tizen>
2289 public Vector2 ScreenPosition
2293 return GetCurrentScreenPosition();
2298 /// Retrieves the screen position and size of the view.<br />
2301 /// The float type Rectangle class is not ready yet.
2302 /// Therefore, it transmits data in Vector4 class.
2303 /// This type should later be changed to the appropriate data type.
2305 [EditorBrowsable(EditorBrowsableState.Never)]
2306 public Vector4 ScreenPositionSize
2310 return GetCurrentScreenPositionSize();
2315 /// Determines whether the pivot point should be used to determine the position of the view.
2316 /// This is false by default.
2318 /// <remarks>If false, then the top-left of the view is used for the position.
2319 /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
2321 /// <since_tizen> 3 </since_tizen>
2322 public bool PositionUsesPivotPoint
2326 if (NUIApplication.IsUsingXaml)
2328 return (bool)GetValue(PositionUsesPivotPointProperty);
2332 return (bool)GetInternalPositionUsesPivotPointProperty(this);
2337 if (NUIApplication.IsUsingXaml)
2339 SetValue(PositionUsesPivotPointProperty, value);
2343 SetInternalPositionUsesPivotPointProperty(this, null, value);
2345 NotifyPropertyChanged();
2350 /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead.
2352 /// <since_tizen> 3 </since_tizen>
2353 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PositionUsesPivotPoint instead. " +
2355 "View view = new View(); " +
2356 "view.PivotPoint = PivotPoint.Center; " +
2357 "view.PositionUsesPivotPoint = true;" +
2358 " This has been deprecated in API5 and will be removed in API8")]
2359 [EditorBrowsable(EditorBrowsableState.Never)]
2360 public bool PositionUsesAnchorPoint
2364 if (NUIApplication.IsUsingXaml)
2366 return (bool)GetValue(PositionUsesAnchorPointProperty);
2370 return (bool)GetInternalPositionUsesAnchorPointProperty(this);
2375 if (NUIApplication.IsUsingXaml)
2377 SetValue(PositionUsesAnchorPointProperty, value);
2381 SetInternalPositionUsesAnchorPointProperty(this, null, value);
2386 private bool InternalPositionUsesAnchorPoint
2390 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint);
2394 Object.InternalSetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint, value);
2395 NotifyPropertyChanged();
2400 /// Queries whether the view is connected to the stage.<br />
2401 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
2403 /// <since_tizen> 3 </since_tizen>
2404 public bool IsOnWindow
2413 /// Gets the depth in the hierarchy for the view.
2415 /// <since_tizen> 3 </since_tizen>
2416 public int HierarchyDepth
2420 return GetHierarchyDepth();
2425 /// Sets the sibling order of the view so the depth position can be defined within the same parent.
2428 /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
2429 /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
2430 /// The values set by this property will likely change.
2432 /// <since_tizen> 3 </since_tizen>
2433 public int SiblingOrder
2437 if (NUIApplication.IsUsingXaml)
2439 return (int)GetValue(SiblingOrderProperty);
2443 return (int)GetInternalSiblingOrderProperty(this);
2448 if (NUIApplication.IsUsingXaml)
2450 SetValue(SiblingOrderProperty, value);
2454 SetInternalSiblingOrderProperty(this, null, value);
2456 Layout?.ChangeLayoutSiblingOrder(value);
2457 NotifyPropertyChanged();
2462 /// Returns the natural size of the view.
2465 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
2467 /// <since_tizen> 5 </since_tizen>
2468 public Vector3 NaturalSize
2472 Vector3 ret = GetNaturalSize();
2473 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2479 /// Returns the natural size (Size2D) of the view.
2482 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
2484 /// <since_tizen> 4 </since_tizen>
2485 public Size2D NaturalSize2D
2489 Vector3 temp = GetNaturalSize();
2490 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2494 sz = new Size2D((int)temp.Width, (int)temp.Height);
2502 /// Gets or sets the origin of a view within its parent's area.<br />
2503 /// 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 />
2504 /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
2505 /// A view's position is the distance between this origin and the view's anchor-point.<br />
2507 /// <pre>The view has been initialized.</pre>
2508 /// <since_tizen> 3 </since_tizen>
2509 public Position ParentOrigin
2513 if (NUIApplication.IsUsingXaml)
2515 var tmp = (Position)GetValue(ParentOriginProperty);
2516 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
2520 var tmp = (Position)GetInternalParentOriginProperty(this);
2521 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
2526 if (NUIApplication.IsUsingXaml)
2528 SetValue(ParentOriginProperty, value);
2532 SetInternalParentOriginProperty(this, null, value);
2534 NotifyPropertyChanged();
2539 /// Gets or sets the anchor-point of a view.<br />
2540 /// 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 />
2541 /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
2542 /// A view position is the distance between its parent-origin and this anchor-point.<br />
2543 /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
2544 /// <pre>The view has been initialized.</pre>
2547 /// The property cascade chaining set is not recommended.
2550 /// This way is recommended for setting the property
2552 /// var view = new View();
2553 /// view.PivotPoint = PivotPoint.Center;
2555 /// This way to set the property is prohibited
2557 /// view.PivotPoint.X = 0.5f; //This does not guarantee a proper operation
2560 /// <since_tizen> 3 </since_tizen>
2561 public Position PivotPoint
2565 if (NUIApplication.IsUsingXaml)
2567 return (Position)GetValue(PivotPointProperty);
2571 return (Position)GetInternalPivotPointProperty(this);
2576 if (NUIApplication.IsUsingXaml)
2578 SetValue(PivotPointProperty, value);
2582 SetInternalPivotPointProperty(this, null, value);
2584 NotifyPropertyChanged();
2589 /// Gets or sets the size width of the view.
2593 /// Animatable - This property can be animated using <c>Animation</c> class.
2595 /// animation.AnimateTo(view, "SizeWidth", 500.0f);
2599 /// <since_tizen> 3 </since_tizen>
2600 public float SizeWidth
2604 if (NUIApplication.IsUsingXaml)
2606 return (float)GetValue(SizeWidthProperty);
2610 return (float)GetInternalSizeWidthProperty(this);
2617 if (NUIApplication.IsUsingXaml)
2619 SetValue(SizeWidthProperty, value);
2623 SetInternalSizeWidthProperty(this, null, value);
2626 NotifyPropertyChanged();
2631 /// Gets or sets the size height of the view.
2635 /// Animatable - This property can be animated using <c>Animation</c> class.
2638 /// animation.AnimateTo(view, "SizeHeight", 500.0f);
2641 /// <since_tizen> 3 </since_tizen>
2642 public float SizeHeight
2646 if (NUIApplication.IsUsingXaml)
2648 return (float)GetValue(SizeHeightProperty);
2652 return (float)GetInternalSizeHeightProperty(this);
2659 if (NUIApplication.IsUsingXaml)
2661 SetValue(SizeHeightProperty, value);
2665 SetInternalSizeHeightProperty(this, null, value);
2669 NotifyPropertyChanged();
2674 /// Gets or sets the position of the view.<br />
2675 /// By default, sets the position vector between the parent origin and pivot point (default).<br />
2676 /// If the position inheritance is disabled, sets the world position.<br />
2680 /// Animatable - This property can be animated using <c>Animation</c> class.
2682 /// animation.AnimateTo(view, "Position", new Position(50, 0));
2685 /// The property cascade chaining set is not recommended.
2688 /// This way is recommended for setting the property
2690 /// var view = new View();
2691 /// view.Position = new Position(100, 200.5f, 0);
2693 /// This way to set the property is prohibited
2695 /// view.Position.Y = 200.5f; //This does not guarantee a proper operation
2698 /// <since_tizen> 3 </since_tizen>
2699 public Position Position
2703 if (NUIApplication.IsUsingXaml)
2705 return (Position)GetValue(PositionProperty);
2709 return (Position2D)GetInternalPositionProperty(this);
2714 if (NUIApplication.IsUsingXaml)
2716 SetValue(PositionProperty, value);
2720 SetInternalPositionProperty(this, null, value);
2722 NotifyPropertyChanged();
2727 /// Gets or sets the position X of the view.
2731 /// Animatable - This property can be animated using <c>Animation</c> class.
2733 /// animation.AnimateTo(view, "PositionX", 50.0f);
2737 /// <since_tizen> 3 </since_tizen>
2738 public float PositionX
2742 if (NUIApplication.IsUsingXaml)
2744 return (float)GetValue(PositionXProperty);
2748 return (float)GetInternalPositionXProperty(this);
2753 if (NUIApplication.IsUsingXaml)
2755 SetValue(PositionXProperty, value);
2759 SetInternalPositionXProperty(this, null, value);
2761 NotifyPropertyChanged();
2766 /// Gets or sets the position Y of the view.
2770 /// Animatable - This property can be animated using <c>Animation</c> class.
2772 /// animation.AnimateTo(view, "PositionY", 50.0f);
2776 /// <since_tizen> 3 </since_tizen>
2777 public float PositionY
2781 if (NUIApplication.IsUsingXaml)
2783 return (float)GetValue(PositionYProperty);
2787 return (float)GetInternalPositionYProperty(this);
2792 if (NUIApplication.IsUsingXaml)
2794 SetValue(PositionYProperty, value);
2798 SetInternalPositionYProperty(this, null, value);
2800 NotifyPropertyChanged();
2805 /// Gets or sets the position Z of the view.
2809 /// Animatable - This property can be animated using <c>Animation</c> class.
2811 /// animation.AnimateTo(view, "PositionZ", 50.0f);
2815 /// <since_tizen> 3 </since_tizen>
2816 public float PositionZ
2820 if (NUIApplication.IsUsingXaml)
2822 return (float)GetValue(PositionZProperty);
2826 return (float)GetInternalPositionZProperty(this);
2831 if (NUIApplication.IsUsingXaml)
2833 SetValue(PositionZProperty, value);
2837 SetInternalPositionZProperty(this, null, value);
2839 NotifyPropertyChanged();
2844 /// Gets or sets the world position of the view.
2846 /// <since_tizen> 3 </since_tizen>
2847 public Vector3 WorldPosition
2851 return GetCurrentWorldPosition();
2856 /// Gets or sets the orientation of the view.<br />
2857 /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
2861 /// This is an asynchronous method.
2864 /// Animatable - This property can be animated using <c>Animation</c> class.
2866 /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
2870 /// <since_tizen> 3 </since_tizen>
2871 public Rotation Orientation
2875 if (NUIApplication.IsUsingXaml)
2877 return (Rotation)GetValue(OrientationProperty);
2881 return (Rotation)GetInternalOrientationProperty(this);
2886 if (NUIApplication.IsUsingXaml)
2888 SetValue(OrientationProperty, value);
2892 SetInternalOrientationProperty(this, null, value);
2894 NotifyPropertyChanged();
2899 /// Gets or sets the world orientation of the view.<br />
2901 /// <since_tizen> 3 </since_tizen>
2902 public Rotation WorldOrientation
2906 Rotation temp = new Rotation();
2907 var pValue = GetProperty(View.Property.WorldOrientation);
2915 /// Gets or sets the scale factor applied to the view.<br />
2919 /// Animatable - This property can be animated using <c>Animation</c> class.
2921 /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
2924 /// The property cascade chaining set is not recommended.
2927 /// This way is recommended for setting the property
2929 /// var view = new View();
2930 /// view.Scale = new Vector3(1.5f, 2.0f, 1.0f);
2932 /// This way to set the property is prohibited
2934 /// view.Scale.Width = 1.5f; //This does not guarantee a proper operation
2937 /// <since_tizen> 3 </since_tizen>
2938 public Vector3 Scale
2942 if (NUIApplication.IsUsingXaml)
2944 return (Vector3)GetValue(ScaleProperty);
2948 return (Vector3)GetInternalScaleProperty(this);
2955 if (NUIApplication.IsUsingXaml)
2957 SetValue(ScaleProperty, value);
2961 SetInternalScaleProperty(this, null, value);
2965 NotifyPropertyChanged();
2970 /// Gets or sets the scale X factor applied to the view.
2974 /// Animatable - This property can be animated using <c>Animation</c> class.
2976 /// animation.AnimateTo(view, "ScaleX", 1.5f);
2980 /// <since_tizen> 3 </since_tizen>
2985 if (NUIApplication.IsUsingXaml)
2987 return (float)GetValue(ScaleXProperty);
2991 return (float)GetInternalScaleXProperty(this);
2998 if (NUIApplication.IsUsingXaml)
3000 SetValue(ScaleXProperty, value);
3004 SetInternalScaleXProperty(this, null, value);
3008 NotifyPropertyChanged();
3013 /// Gets or sets the scale Y factor applied to the view.
3017 /// Animatable - This property can be animated using <c>Animation</c> class.
3019 /// animation.AnimateTo(view, "ScaleY", 1.5f);
3023 /// <since_tizen> 3 </since_tizen>
3028 if (NUIApplication.IsUsingXaml)
3030 return (float)GetValue(ScaleYProperty);
3034 return (float)GetInternalScaleYProperty(this);
3041 if (NUIApplication.IsUsingXaml)
3043 SetValue(ScaleYProperty, value);
3047 SetInternalScaleYProperty(this, null, value);
3051 NotifyPropertyChanged();
3056 /// Gets or sets the scale Z factor applied to the view.
3060 /// Animatable - This property can be animated using <c>Animation</c> class.
3062 /// animation.AnimateTo(view, "ScaleZ", 1.5f);
3066 /// <since_tizen> 3 </since_tizen>
3071 if (NUIApplication.IsUsingXaml)
3073 return (float)GetValue(ScaleZProperty);
3077 return (float)GetInternalScaleZProperty(this);
3084 if (NUIApplication.IsUsingXaml)
3086 SetValue(ScaleZProperty, value);
3090 SetInternalScaleZProperty(this, null, value);
3094 NotifyPropertyChanged();
3099 /// Gets the world scale of the view.
3101 /// <since_tizen> 3 </since_tizen>
3102 public Vector3 WorldScale
3106 return GetCurrentWorldScale();
3111 /// Retrieves the visibility flag of the view.
3115 /// If the view is not visible, then the view and its children will not be rendered.
3116 /// 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.
3119 /// Animatable - This property can be animated using <c>Animation</c> class.
3121 /// animation.AnimateTo(view, "Visibility", false);
3125 /// <since_tizen> 3 </since_tizen>
3126 public bool Visibility
3130 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.VISIBLE);
3135 /// Gets the view's world color.
3137 /// <since_tizen> 3 </since_tizen>
3138 public Vector4 WorldColor
3142 return GetCurrentWorldColor();
3147 /// Gets or sets the view's name.
3149 /// <since_tizen> 3 </since_tizen>
3154 if (NUIApplication.IsUsingXaml)
3156 return (string)GetValue(NameProperty);
3160 return (string)GetInternalNameProperty(this);
3167 if (NUIApplication.IsUsingXaml)
3169 SetValue(NameProperty, value);
3173 SetInternalNameProperty(this, null, value);
3177 NotifyPropertyChanged();
3182 /// Get the number of children held by the view.
3184 /// <since_tizen> 3 </since_tizen>
3185 public new uint ChildCount
3189 return Convert.ToUInt32(Children.Count);
3194 /// Gets the view's ID.
3197 /// <since_tizen> 3 </since_tizen>
3207 /// Gets or sets the status of whether the view should emit touch or hover signals.
3208 /// If a View is made insensitive, then the View and its children are not hittable.
3210 /// <since_tizen> 3 </since_tizen>
3211 public bool Sensitive
3215 if (NUIApplication.IsUsingXaml)
3217 return (bool)GetValue(SensitiveProperty);
3221 return (bool)GetInternalSensitiveProperty(this);
3226 if (NUIApplication.IsUsingXaml)
3228 SetValue(SensitiveProperty, value);
3232 SetInternalSensitiveProperty(this, null, value);
3234 NotifyPropertyChanged();
3239 /// Gets or sets the status of whether the view should be enabled user interactions.
3240 /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled.
3242 /// <since_tizen> tizen_next </since_tizen>
3243 [EditorBrowsable(EditorBrowsableState.Never)]
3244 public bool IsEnabled
3248 if (NUIApplication.IsUsingXaml)
3250 return (bool)GetValue(IsEnabledProperty);
3254 return (bool)GetInternalIsEnabledProperty(this);
3259 if (NUIApplication.IsUsingXaml)
3261 SetValue(IsEnabledProperty, value);
3265 SetInternalIsEnabledProperty(this, null, value);
3267 NotifyPropertyChanged();
3272 /// 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.
3274 /// <since_tizen> 3 </since_tizen>
3275 public bool LeaveRequired
3279 if (NUIApplication.IsUsingXaml)
3281 return (bool)GetValue(LeaveRequiredProperty);
3285 return (bool)GetInternalLeaveRequiredProperty(this);
3290 if (NUIApplication.IsUsingXaml)
3292 SetValue(LeaveRequiredProperty, value);
3296 SetInternalLeaveRequiredProperty(this, null, value);
3298 NotifyPropertyChanged();
3303 /// Gets or sets the status of whether a child view inherits it's parent's orientation.
3305 /// <since_tizen> 3 </since_tizen>
3306 public bool InheritOrientation
3310 if (NUIApplication.IsUsingXaml)
3312 return (bool)GetValue(InheritOrientationProperty);
3316 return (bool)GetInternalInheritOrientationProperty(this);
3321 if (NUIApplication.IsUsingXaml)
3323 SetValue(InheritOrientationProperty, value);
3327 SetInternalInheritOrientationProperty(this, null, value);
3329 NotifyPropertyChanged();
3334 /// Gets or sets the status of whether a child view inherits it's parent's scale.
3336 /// <since_tizen> 3 </since_tizen>
3337 public bool InheritScale
3341 if (NUIApplication.IsUsingXaml)
3343 return (bool)GetValue(InheritScaleProperty);
3347 return (bool)GetInternalInheritScaleProperty(this);
3352 if (NUIApplication.IsUsingXaml)
3354 SetValue(InheritScaleProperty, value);
3358 SetInternalInheritScaleProperty(this, null, value);
3360 NotifyPropertyChanged();
3365 /// Gets or sets the status of how the view and its children should be drawn.<br />
3366 /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
3367 /// 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 />
3368 /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
3369 /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
3370 /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
3372 /// <since_tizen> 3 </since_tizen>
3373 public DrawModeType DrawMode
3377 if (NUIApplication.IsUsingXaml)
3379 return (DrawModeType)GetValue(DrawModeProperty);
3383 return (DrawModeType)GetInternalDrawModeProperty(this);
3388 if (NUIApplication.IsUsingXaml)
3390 SetValue(DrawModeProperty, value);
3394 SetInternalDrawModeProperty(this, null, value);
3396 NotifyPropertyChanged();
3401 /// Gets or sets the relative to parent size factor of the view.<br />
3402 /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
3403 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
3406 /// The property cascade chaining set is not recommended.
3409 /// This way is recommended for setting the property
3411 /// var text = new TextField();
3412 /// text.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
3414 /// This way to set the property is prohibited
3416 /// text.SizeModeFactor.Width = 1.0f; //This does not guarantee a proper operation
3419 /// <since_tizen> 3 </since_tizen>
3420 public Vector3 SizeModeFactor
3424 if (NUIApplication.IsUsingXaml)
3426 return (Vector3)GetValue(SizeModeFactorProperty);
3430 return (Vector3)GetInternalSizeModeFactorProperty(this);
3437 if (NUIApplication.IsUsingXaml)
3439 SetValue(SizeModeFactorProperty, value);
3443 SetInternalSizeModeFactorProperty(this, null, value);
3447 NotifyPropertyChanged();
3452 /// Gets or sets the width resize policy to be used.
3454 /// <since_tizen> 3 </since_tizen>
3455 public ResizePolicyType WidthResizePolicy
3459 if (NUIApplication.IsUsingXaml)
3461 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
3465 return (ResizePolicyType)GetInternalWidthResizePolicyProperty(this);
3470 if (NUIApplication.IsUsingXaml)
3472 SetValue(WidthResizePolicyProperty, value);
3476 SetInternalWidthResizePolicyProperty(this, null, value);
3478 NotifyPropertyChanged();
3483 /// Gets or sets the height resize policy to be used.
3485 /// <since_tizen> 3 </since_tizen>
3486 public ResizePolicyType HeightResizePolicy
3490 if (NUIApplication.IsUsingXaml)
3492 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
3496 return (ResizePolicyType)GetInternalHeightResizePolicyProperty(this);
3501 if (NUIApplication.IsUsingXaml)
3503 SetValue(HeightResizePolicyProperty, value);
3507 SetInternalHeightResizePolicyProperty(this, null, value);
3509 NotifyPropertyChanged();
3514 /// Gets or sets the policy to use when setting size with size negotiation.<br />
3515 /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
3517 /// <since_tizen> 3 </since_tizen>
3518 public SizeScalePolicyType SizeScalePolicy
3522 if (NUIApplication.IsUsingXaml)
3524 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
3528 return (SizeScalePolicyType)GetInternalSizeScalePolicyProperty(this);
3533 if (NUIApplication.IsUsingXaml)
3535 SetValue(SizeScalePolicyProperty, value);
3539 SetInternalSizeScalePolicyProperty(this, null, value);
3541 NotifyPropertyChanged();
3546 /// Gets or sets the status of whether the width size is dependent on the height size.
3548 /// <since_tizen> 3 </since_tizen>
3549 public bool WidthForHeight
3553 if (NUIApplication.IsUsingXaml)
3555 return (bool)GetValue(WidthForHeightProperty);
3559 return (bool)GetInternalWidthForHeightProperty(this);
3564 if (NUIApplication.IsUsingXaml)
3566 SetValue(WidthForHeightProperty, value);
3570 SetInternalWidthForHeightProperty(this, null, value);
3572 NotifyPropertyChanged();
3577 /// Gets or sets the status of whether the height size is dependent on the width size.
3579 /// <since_tizen> 3 </since_tizen>
3580 public bool HeightForWidth
3584 if (NUIApplication.IsUsingXaml)
3586 return (bool)GetValue(HeightForWidthProperty);
3590 return (bool)GetInternalHeightForWidthProperty(this);
3595 if (NUIApplication.IsUsingXaml)
3597 SetValue(HeightForWidthProperty, value);
3601 SetInternalHeightForWidthProperty(this, null, value);
3603 NotifyPropertyChanged();
3608 /// Gets or sets the padding for use in layout.
3611 /// The property cascade chaining set is not recommended.
3614 /// This way is recommended for setting the property
3616 /// var view = new View();
3617 /// view.Padding = new Extents(5, 5, 5, 5);
3619 /// This way to set the property is prohibited
3621 /// view.Padding.Start = 5; //This does not guarantee a proper operation
3624 /// <since_tizen> 5 </since_tizen>
3625 public Extents Padding
3629 if (NUIApplication.IsUsingXaml)
3631 return (Extents)GetValue(PaddingProperty);
3635 return (Extents)GetInternalPaddingProperty(this);
3642 if (NUIApplication.IsUsingXaml)
3644 SetValue(PaddingProperty, value);
3648 SetInternalPaddingProperty(this, null, value);
3652 NotifyPropertyChanged();
3657 /// Gets or sets the minimum size the view can be assigned in size negotiation.
3659 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
3661 /// The property cascade chaining set is not recommended.
3664 /// This way is recommended for setting the property
3666 /// var view = new View();
3667 /// view.MinimumSize = new Size2D(100, 200);
3669 /// This way to set the property is prohibited
3671 /// view.MinimumSize.Width = 100; //This does not guarantee a proper operation
3674 /// <since_tizen> 3 </since_tizen>
3675 public Size2D MinimumSize
3679 if (NUIApplication.IsUsingXaml)
3681 return (Size2D)GetValue(MinimumSizeProperty);
3685 return (Size2D)GetInternalMinimumSizeProperty(this);
3693 throw new ArgumentNullException(nameof(value));
3697 // Note: it only works if minimum size is >= than natural size.
3698 // To force the size it should be done through the width&height spec or Size2D.
3699 layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
3700 layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
3701 layout.RequestLayout();
3703 if (NUIApplication.IsUsingXaml)
3705 SetValue(MinimumSizeProperty, value);
3709 SetInternalMinimumSizeProperty(this, null, value);
3712 NotifyPropertyChanged();
3717 /// Gets or sets the maximum size the view can be assigned in size negotiation.
3720 /// This way is recommended for setting the property
3722 /// var view = new View();
3723 /// view.MaximumSize = new Size2D(100, 200);
3725 /// This way to set the property is prohibited
3727 /// view.MaximumSize.Height = 200; //This does not guarantee a proper operation
3730 /// <since_tizen> 3 </since_tizen>
3731 public Size2D MaximumSize
3735 if (NUIApplication.IsUsingXaml)
3737 return (Size2D)GetValue(MaximumSizeProperty);
3741 return (Size2D)GetInternalMaximumSizeProperty(this);
3746 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
3747 // MATCH_PARENT spec + parent container size can be used to limit
3750 layout.RequestLayout();
3753 if (NUIApplication.IsUsingXaml)
3755 SetValue(MaximumSizeProperty, value);
3759 SetInternalMaximumSizeProperty(this, null, value);
3762 NotifyPropertyChanged();
3767 /// Gets or sets whether a child view inherits it's parent's position.<br />
3768 /// Default is to inherit.<br />
3769 /// 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 />
3771 /// <since_tizen> 3 </since_tizen>
3772 public bool InheritPosition
3776 if (NUIApplication.IsUsingXaml)
3778 return (bool)GetValue(InheritPositionProperty);
3782 return (bool)GetInternalInheritPositionProperty(this);
3787 if (NUIApplication.IsUsingXaml)
3789 SetValue(InheritPositionProperty, value);
3793 SetInternalInheritPositionProperty(this, null, value);
3795 NotifyPropertyChanged();
3800 /// Gets or sets the clipping behavior (mode) of it's children.
3802 /// <since_tizen> 3 </since_tizen>
3803 public ClippingModeType ClippingMode
3807 if (NUIApplication.IsUsingXaml)
3809 return (ClippingModeType)GetValue(ClippingModeProperty);
3813 return (ClippingModeType)GetInternalClippingModeProperty(this);
3818 if (NUIApplication.IsUsingXaml)
3820 SetValue(ClippingModeProperty, value);
3824 SetInternalClippingModeProperty(this, null, value);
3826 NotifyPropertyChanged();
3831 /// Gets the number of renderers held by the view.
3833 /// <since_tizen> 3 </since_tizen>
3834 public uint RendererCount
3838 return GetRendererCount();
3843 /// This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead.
3846 /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
3848 /// <since_tizen> 3 </since_tizen>
3849 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead. " +
3851 "View view = new View(); " +
3852 "view.PivotPoint = PivotPoint.Center; " +
3853 "view.PositionUsesPivotPoint = true;")]
3854 [EditorBrowsable(EditorBrowsableState.Never)]
3855 public Position AnchorPoint
3859 if (NUIApplication.IsUsingXaml)
3861 return (Position)GetValue(AnchorPointProperty);
3865 return (Position)GetInternalAnchorPointProperty(this);
3872 if (NUIApplication.IsUsingXaml)
3874 SetValue(AnchorPointProperty, value);
3878 SetInternalAnchorPointProperty(this, null, value);
3884 private Position InternalAnchorPoint
3888 return GetCurrentAnchorPoint();
3892 SetAnchorPoint(value);
3893 NotifyPropertyChanged();
3898 /// Sets the size of a view for the width, the height and the depth.<br />
3899 /// Geometry can be scaled to fit within this area.<br />
3900 /// This does not interfere with the view's scale factor.<br />
3901 /// The views default depth is the minimum of width and height.<br />
3905 /// Animatable - This property can be animated using <c>Animation</c> class.
3907 /// animation.AnimateTo(view, "Size", new Size(100, 100));
3910 /// The property cascade chaining set is not recommended.
3913 /// This way is recommended for setting the property
3915 /// var view = new View();
3916 /// view.Size = new Size(100.5f, 200, 0);
3918 /// This way to set the property is prohibited
3920 /// view.Size.Width = 100.5f; //This does not guarantee a proper operation
3923 /// <since_tizen> 5 </since_tizen>
3928 if (NUIApplication.IsUsingXaml)
3930 return (Size)GetValue(SizeProperty);
3934 return (Size)GetInternalSizeProperty(this);
3939 if (NUIApplication.IsUsingXaml)
3941 SetValue(SizeProperty, value);
3945 SetInternalSizeProperty(this, null, value);
3947 NotifyPropertyChanged();
3952 /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead.
3954 /// <since_tizen> 3 </since_tizen>
3955 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. " +
3957 "Container parent = view.GetParent(); " +
3958 "View view = parent as View;")]
3959 [EditorBrowsable(EditorBrowsableState.Never)]
3960 public new View Parent
3965 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
3966 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
3967 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
3969 if (basehandle is Layer layer)
3971 ret = new View(Layer.getCPtr(layer).Handle, false);
3972 NUILog.Error("This Parent property is deprecated, should do not be used");
3976 ret = basehandle as View;
3979 Interop.BaseHandle.DeleteBaseHandle(CPtr);
3980 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
3982 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
3988 /// Gets/Sets whether inherit parent's the layout Direction.
3990 /// <since_tizen> 4 </since_tizen>
3991 public bool InheritLayoutDirection
3995 if (NUIApplication.IsUsingXaml)
3997 return (bool)GetValue(InheritLayoutDirectionProperty);
4001 return (bool)GetInternalInheritLayoutDirectionProperty(this);
4006 if (NUIApplication.IsUsingXaml)
4008 SetValue(InheritLayoutDirectionProperty, value);
4012 SetInternalInheritLayoutDirectionProperty(this, null, value);
4014 NotifyPropertyChanged();
4019 /// Gets/Sets the layout Direction.
4021 /// <since_tizen> 4 </since_tizen>
4022 public ViewLayoutDirectionType LayoutDirection
4026 if (NUIApplication.IsUsingXaml)
4028 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
4032 return (ViewLayoutDirectionType)GetInternalLayoutDirectionProperty(this);
4037 if (NUIApplication.IsUsingXaml)
4039 SetValue(LayoutDirectionProperty, value);
4043 SetInternalLayoutDirectionProperty(this, null, value);
4045 NotifyPropertyChanged();
4046 layout?.RequestLayout();
4051 /// Gets or sets the Margin for use in layout.
4054 /// Margin property is supported by Layout algorithms and containers.
4055 /// Please Set Layout if you want to use Margin property.
4056 /// The property cascade chaining set is not recommended.
4059 /// This way is recommended for setting the property
4061 /// var view = new View();
4062 /// view.Margin = new Extents(10, 5, 15, 20);
4064 /// This way to set the property is prohibited
4066 /// view.Margin.Top = 15; //This does not guarantee a proper operation
4069 /// <since_tizen> 4 </since_tizen>
4070 public Extents Margin
4074 if (NUIApplication.IsUsingXaml)
4076 return (Extents)GetValue(MarginProperty);
4080 return (Extents)GetInternalMarginProperty(this);
4086 if (NUIApplication.IsUsingXaml)
4088 SetValue(MarginProperty, value);
4092 SetInternalMarginProperty(this, null, value);
4095 NotifyPropertyChanged();
4100 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
4104 /// // matchParentView matches its size to its parent size.
4105 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
4106 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
4108 /// // wrapContentView wraps its children with their desired size.
4109 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
4110 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
4112 /// // exactSizeView shows itself with an exact size.
4113 /// exactSizeView.WidthSpecification = 100;
4114 /// exactSizeView.HeightSpecification = 100;
4117 /// <since_tizen> 6 </since_tizen>
4118 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
4119 public int WidthSpecification
4123 if (NUIApplication.IsUsingXaml)
4125 return (int)GetValue(WidthSpecificationProperty);
4129 return (int)GetInternalWidthSpecificationProperty(this);
4134 if (NUIApplication.IsUsingXaml)
4136 SetValue(WidthSpecificationProperty, value);
4140 SetInternalWidthSpecificationProperty(this, null, value);
4142 NotifyPropertyChanged();
4146 private int InternalWidthSpecification
4154 if (value == widthPolicy)
4157 widthPolicy = value;
4158 if (widthPolicy >= 0)
4160 SizeWidth = widthPolicy;
4162 layout?.RequestLayout();
4167 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
4171 /// // matchParentView matches its size to its parent size.
4172 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
4173 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
4175 /// // wrapContentView wraps its children with their desired size.
4176 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
4177 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
4179 /// // exactSizeView shows itself with an exact size.
4180 /// exactSizeView.WidthSpecification = 100;
4181 /// exactSizeView.HeightSpecification = 100;
4184 /// <since_tizen> 6 </since_tizen>
4185 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
4186 public int HeightSpecification
4190 if (NUIApplication.IsUsingXaml)
4192 return (int)GetValue(HeightSpecificationProperty);
4196 return (int)GetInternalHeightSpecificationProperty(this);
4201 if (NUIApplication.IsUsingXaml)
4203 SetValue(HeightSpecificationProperty, value);
4207 SetInternalHeightSpecificationProperty(this, null, value);
4209 NotifyPropertyChanged();
4213 private int InternalHeightSpecification
4217 return heightPolicy;
4221 if (value == heightPolicy)
4224 heightPolicy = value;
4225 if (heightPolicy >= 0)
4227 SizeHeight = heightPolicy;
4229 layout?.RequestLayout();
4234 /// Gets the List of transitions for this View.
4236 /// <since_tizen> 6 </since_tizen>
4237 public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
4241 if (layoutTransitions == null)
4243 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
4245 return layoutTransitions;
4250 /// Sets a layout transitions for this View.
4252 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
4254 /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
4256 /// <since_tizen> 6 </since_tizen>
4257 public LayoutTransition LayoutTransition
4261 if (NUIApplication.IsUsingXaml)
4263 return GetValue(LayoutTransitionProperty) as LayoutTransition;
4267 return GetInternalLayoutTransitionProperty(this) as LayoutTransition;
4272 if (NUIApplication.IsUsingXaml)
4274 SetValue(LayoutTransitionProperty, value);
4278 SetInternalLayoutTransitionProperty(this, null, value);
4280 NotifyPropertyChanged();
4284 private LayoutTransition InternalLayoutTransition
4288 return layoutTransition;
4294 throw new global::System.ArgumentNullException(nameof(value));
4296 if (layoutTransitions == null)
4298 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
4301 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
4303 AttachTransitionsToChildren(value);
4305 layoutTransition = value;
4310 /// This has been deprecated in API5 and will be removed in API8. Use Padding instead.
4313 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
4315 /// <since_tizen> 4 </since_tizen>
4316 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use Padding instead.")]
4317 [EditorBrowsable(EditorBrowsableState.Never)]
4318 public Extents PaddingEX
4322 if (NUIApplication.IsUsingXaml)
4324 return GetValue(PaddingEXProperty) as Extents;
4328 return GetInternalPaddingEXProperty(this) as Extents;
4333 if (NUIApplication.IsUsingXaml)
4335 SetValue(PaddingEXProperty, value);
4339 SetInternalPaddingEXProperty(this, null, value);
4344 private Extents InternalPaddingEX
4348 Extents temp = new Extents(0, 0, 0, 0);
4349 var pValue = GetProperty(View.Property.PADDING);
4352 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
4358 var temp = new Tizen.NUI.PropertyValue(value);
4359 SetProperty(View.Property.PADDING, temp);
4361 NotifyPropertyChanged();
4362 layout?.RequestLayout();
4367 /// The Color of View. This is an RGBA value.
4368 /// Each RGBA components match as <see cref="ColorRed"/>, <see cref="ColorGreen"/>, <see cref="ColorBlue"/>, and <see cref="Opacity"/>.
4369 /// This property will multiply the final color of this view. (BackgroundColor, BorderlineColor, BackgroundImage, etc).
4370 /// For example, if view.BackgroundColor = Color.Yellow and view.Color = Color.Purple, this view will shown as Red.
4371 /// Inherient of color value depend on <see cref="ColorMode"/>.
4375 /// Animatable - This property can be animated using <c>Animation</c> class.
4377 /// The property cascade chaining set is not recommended.
4380 /// This way is recommended for setting the property
4382 /// var view = new View();
4383 /// view.Color = new Color(0.5f, 0.2f, 0.1f, 0.5f);
4385 /// This way to set the property is prohibited
4387 /// view.Color.A = 0.5f; //This does not guarantee a proper operation
4390 [EditorBrowsable(EditorBrowsableState.Never)]
4395 if (NUIApplication.IsUsingXaml)
4397 return (Color)GetValue(ColorProperty);
4401 return (Color)GetInternalColorProperty(this);
4408 if (NUIApplication.IsUsingXaml)
4410 SetValue(ColorProperty, value);
4414 SetInternalColorProperty(this, null, value);
4418 NotifyPropertyChanged();
4423 /// The Red component of View.Color.
4427 /// Animatable - This property can be animated using <c>Animation</c> class.
4430 [EditorBrowsable(EditorBrowsableState.Never)]
4431 public float ColorRed
4435 if (NUIApplication.IsUsingXaml)
4437 return (float)GetValue(ColorRedProperty);
4441 return (float)GetInternalColorRedProperty(this);
4448 if (NUIApplication.IsUsingXaml)
4450 SetValue(ColorRedProperty, value);
4454 SetInternalColorRedProperty(this, null, value);
4458 NotifyPropertyChanged();
4463 /// The Green component of View.Color.
4467 /// Animatable - This property can be animated using <c>Animation</c> class.
4470 [EditorBrowsable(EditorBrowsableState.Never)]
4471 public float ColorGreen
4475 if (NUIApplication.IsUsingXaml)
4477 return (float)GetValue(ColorGreenProperty);
4481 return (float)GetInternalColorGreenProperty(this);
4488 if (NUIApplication.IsUsingXaml)
4490 SetValue(ColorGreenProperty, value);
4494 SetInternalColorGreenProperty(this, null, value);
4498 NotifyPropertyChanged();
4503 /// The Blue component of View.Color.
4507 /// Animatable - This property can be animated using <c>Animation</c> class.
4510 [EditorBrowsable(EditorBrowsableState.Never)]
4511 public float ColorBlue
4515 if (NUIApplication.IsUsingXaml)
4517 return (float)GetValue(ColorBlueProperty);
4521 return (float)GetInternalColorBlueProperty(this);
4528 if (NUIApplication.IsUsingXaml)
4530 SetValue(ColorBlueProperty, value);
4534 SetInternalColorBlueProperty(this, null, value);
4538 NotifyPropertyChanged();
4543 /// Set the layout on this View. Replaces any existing Layout.
4546 /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
4548 /// <since_tizen> 6 </since_tizen>
4549 public LayoutItem Layout
4553 if (NUIApplication.IsUsingXaml)
4555 return GetValue(LayoutProperty) as LayoutItem;
4559 return GetInternalLayoutProperty(this) as LayoutItem;
4564 if (NUIApplication.IsUsingXaml)
4566 SetValue(LayoutProperty, value);
4570 SetInternalLayoutProperty(this, null, value);
4575 private LayoutItem InternalLayout
4583 // Do nothing if layout provided is already set on this View.
4584 if (value == layout)
4589 LayoutingDisabled = false;
4592 // If new layout being set already has a owner then that owner receives a replacement default layout.
4593 // First check if the layout to be set already has a owner.
4594 if (value?.Owner != null)
4596 // Previous owner of the layout gets a default layout as a replacement.
4597 value.Owner.Layout = new AbsoluteLayout()
4599 // Copy Margin and Padding to replacement LayoutGroup.
4600 Margin = value.Margin,
4601 Padding = value.Padding,
4605 // Copy Margin and Padding to new layout being set or restore padding and margin back to
4606 // View if no replacement. Previously margin and padding values would have been moved from
4607 // the View to the layout.
4608 if (layout != null) // Existing layout
4612 // Existing layout being replaced so copy over margin and padding values.
4613 value.Margin = layout.Margin;
4614 value.Padding = layout.Padding;
4615 value.SetPositionByLayout = !excludeLayouting;
4619 // Layout not being replaced so restore margin and padding to View.
4620 SetValue(MarginProperty, layout.Margin);
4621 SetValue(PaddingProperty, layout.Padding);
4622 NotifyPropertyChanged();
4627 // First Layout to be added to the View hence copy
4629 // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
4632 Extents margin = Margin;
4633 Extents padding = Padding;
4634 bool setMargin = false;
4635 bool setPadding = false;
4637 if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
4639 // If View already has a margin set then store it in Layout instead.
4640 value.Margin = margin;
4641 SetValue(MarginProperty, new Extents(0, 0, 0, 0));
4645 // The calculation of the native size of the text component requires padding.
4646 // Don't overwrite the zero padding.
4647 bool isTextLayout = (value is Tizen.NUI.BaseComponents.TextLabel.TextLabelLayout) ||
4648 (value is Tizen.NUI.BaseComponents.TextField.TextFieldLayout) ||
4649 (value is Tizen.NUI.BaseComponents.TextEditor.TextEditorLayout);
4651 if (!isTextLayout && (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0))
4653 // If View already has a padding set then store it in Layout instead.
4654 value.Padding = padding;
4655 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
4659 if (setMargin || setPadding)
4661 NotifyPropertyChanged();
4664 value.SetPositionByLayout = !excludeLayouting;
4668 // Remove existing layout from it's parent layout group.
4671 // Set layout to this view
4677 /// The weight of the View, used to share available space in a layout with siblings.
4679 /// <since_tizen> 6 </since_tizen>
4689 layout?.RequestLayout();
4694 /// Whether to load the BackgroundImage synchronously.
4695 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
4696 /// Note: For Normal Quad images only.
4698 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
4699 [EditorBrowsable(EditorBrowsableState.Never)]
4700 public bool BackgroundImageSynchronosLoading
4704 if (NUIApplication.IsUsingXaml)
4706 return (bool)GetValue(BackgroundImageSynchronosLoadingProperty);
4710 return (bool)GetInternalBackgroundImageSynchronosLoadingProperty(this);
4715 if (NUIApplication.IsUsingXaml)
4717 SetValue(BackgroundImageSynchronosLoadingProperty, value);
4721 SetInternalBackgroundImageSynchronosLoadingProperty(this, null, value);
4723 NotifyPropertyChanged();
4727 private bool InternalBackgroundImageSynchronosLoading
4731 return BackgroundImageSynchronousLoading;
4735 BackgroundImageSynchronousLoading = value;
4740 /// Whether to load the BackgroundImage synchronously.
4741 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
4742 /// Note: For Normal Quad images only.
4744 /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
4745 [EditorBrowsable(EditorBrowsableState.Never)]
4746 public bool BackgroundImageSynchronousLoading
4750 if (NUIApplication.IsUsingXaml)
4752 return (bool)GetValue(BackgroundImageSynchronousLoadingProperty);
4756 return (bool)GetInternalBackgroundImageSynchronousLoadingProperty(this);
4761 if (NUIApplication.IsUsingXaml)
4763 SetValue(BackgroundImageSynchronousLoadingProperty, value);
4767 SetInternalBackgroundImageSynchronousLoadingProperty(this, null, value);
4769 NotifyPropertyChanged();
4773 private bool InternalBackgroundImageSynchronousLoading
4777 return backgroundImageSynchronousLoading;
4781 backgroundImageSynchronousLoading = value;
4783 if (!string.IsNullOrEmpty(BackgroundImage))
4785 PropertyMap bgMap = this.Background;
4786 var temp = new PropertyValue(backgroundImageSynchronousLoading);
4787 bgMap[ImageVisualProperty.SynchronousLoading] = temp;
4794 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
4795 [EditorBrowsable(EditorBrowsableState.Never)]
4796 public Vector4 UpdateAreaHint
4800 if (NUIApplication.IsUsingXaml)
4802 return (Vector4)GetValue(UpdateAreaHintProperty);
4806 return (Vector4)GetInternalUpdateAreaHintProperty(this);
4811 if (NUIApplication.IsUsingXaml)
4813 SetValue(UpdateAreaHintProperty, value);
4817 SetInternalUpdateAreaHintProperty(this, null, value);
4819 NotifyPropertyChanged();
4824 /// Enable/Disable ControlState propagation for children.
4825 /// It is false by default.
4826 /// If the View needs to share ControlState with descendants, please set it true.
4827 /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
4829 [EditorBrowsable(EditorBrowsableState.Never)]
4830 public bool EnableControlStatePropagation
4834 if (NUIApplication.IsUsingXaml)
4836 return (bool)GetValue(EnableControlStatePropagationProperty);
4840 return (bool)GetInternalEnableControlStatePropagationProperty(this);
4845 if (NUIApplication.IsUsingXaml)
4847 SetValue(EnableControlStatePropagationProperty, value);
4851 SetInternalEnableControlStatePropagationProperty(this, null, value);
4853 NotifyPropertyChanged();
4857 private bool InternalEnableControlStatePropagation
4859 get => themeData?.ControlStatePropagation ?? false;
4862 if (InternalEnableControlStatePropagation == value) return;
4864 if (themeData == null) themeData = new ThemeData();
4866 themeData.ControlStatePropagation = value;
4868 foreach (View child in Children)
4870 child.EnableControlStatePropagation = value;
4876 /// The ControlStates can propagate from the parent.
4877 /// Listed ControlStates will be accepted propagation of the parent ControlState changes
4878 /// if parent view EnableControlState is true.
4879 /// <see cref="EnableControlState"/>.
4880 /// Default is ControlState.All, so every ControlStates will be propagated from the parent.
4882 [EditorBrowsable(EditorBrowsableState.Never)]
4883 public ControlState PropagatableControlStates
4887 if (NUIApplication.IsUsingXaml)
4889 return (ControlState)GetValue(PropagatableControlStatesProperty);
4893 return (ControlState)GetInternalPropagatableControlStatesProperty(this);
4898 if (NUIApplication.IsUsingXaml)
4900 SetValue(PropagatableControlStatesProperty, value);
4904 SetInternalPropagatableControlStatesProperty(this, null, value);
4906 NotifyPropertyChanged();
4910 private ControlState InternalPropagatableControlStates
4912 get => propagatableControlStates;
4913 set => propagatableControlStates = value;
4917 /// By default, it is false in View, true in Control.
4918 /// Note that if the value is true, the View will be a touch receptor.
4920 [EditorBrowsable(EditorBrowsableState.Never)]
4921 public bool EnableControlState
4925 if (NUIApplication.IsUsingXaml)
4927 return (bool)GetValue(EnableControlStateProperty);
4931 return (bool)GetInternalEnableControlStateProperty(this);
4936 if (NUIApplication.IsUsingXaml)
4938 SetValue(EnableControlStateProperty, value);
4942 SetInternalEnableControlStateProperty(this, null, value);
4948 /// Whether the actor grab all touches even if touch leaves its boundary.
4950 /// <returns>true, if it grab all touch after start</returns>
4951 [EditorBrowsable(EditorBrowsableState.Never)]
4952 public bool GrabTouchAfterLeave
4956 if (NUIApplication.IsUsingXaml)
4958 return (bool)GetValue(GrabTouchAfterLeaveProperty);
4962 return (bool)GetInternalGrabTouchAfterLeaveProperty(this);
4967 if (NUIApplication.IsUsingXaml)
4969 SetValue(GrabTouchAfterLeaveProperty, value);
4973 SetInternalGrabTouchAfterLeaveProperty(this, null, value);
4978 private bool InternalGrabTouchAfterLeave
4982 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart);
4986 Object.InternalSetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart, value);
4988 // Use custom HitTest callback only if GrabTouchAfterLeave is true.
4991 RegisterHitTestCallback();
4995 UnregisterHitTestCallback();
4998 NotifyPropertyChanged();
5003 /// Whether the view will only receive own touch.
5005 /// <returns>true, if it only receives touches that started from itself.</returns>
5006 [EditorBrowsable(EditorBrowsableState.Never)]
5007 public bool AllowOnlyOwnTouch
5011 if (NUIApplication.IsUsingXaml)
5013 return (bool)GetValue(AllowOnlyOwnTouchProperty);
5017 return (bool)GetInternalAllowOnlyOwnTouchProperty(this);
5022 if (NUIApplication.IsUsingXaml)
5024 SetValue(AllowOnlyOwnTouchProperty, value);
5028 SetInternalAllowOnlyOwnTouchProperty(this, null, value);
5033 private bool InternalAllowOnlyOwnTouch
5037 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch);
5041 Object.InternalSetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch, value);
5042 NotifyPropertyChanged();
5047 /// Determines which blend equation will be used to render renderers of this actor.
5049 /// <returns>blend equation enum currently assigned</returns>
5050 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
5051 [EditorBrowsable(EditorBrowsableState.Never)]
5052 public BlendEquationType BlendEquation
5056 if (NUIApplication.IsUsingXaml)
5058 return (BlendEquationType)GetValue(BlendEquationProperty);
5062 return (BlendEquationType)GetInternalBlendEquationProperty(this);
5067 if (NUIApplication.IsUsingXaml)
5069 SetValue(BlendEquationProperty, value);
5073 SetInternalBlendEquationProperty(this, null, value);
5078 private BlendEquationType InternalBlendEquation
5082 return (BlendEquationType)Object.InternalGetPropertyInt(SwigCPtr, View.Property.BlendEquation);
5086 Object.InternalSetPropertyInt(SwigCPtr, View.Property.BlendEquation, (int)value);
5087 NotifyPropertyChanged();
5092 /// If the value is true, the View will change its style as the theme changes.
5093 /// The default value is false in normal case but it can be true when the NUIApplication is created with <see cref="NUIApplication.ThemeOptions.ThemeChangeSensitive"/>.
5095 /// <since_tizen> 9 </since_tizen>
5096 public bool ThemeChangeSensitive
5100 if (NUIApplication.IsUsingXaml)
5102 return (bool)GetValue(ThemeChangeSensitiveProperty);
5106 return (bool)GetInternalThemeChangeSensitiveProperty(this);
5111 if (NUIApplication.IsUsingXaml)
5113 SetValue(ThemeChangeSensitiveProperty, value);
5117 SetInternalThemeChangeSensitiveProperty(this, null, value);
5123 /// Create Style, it is abstract function and must be override.
5125 [EditorBrowsable(EditorBrowsableState.Never)]
5126 protected virtual ViewStyle CreateViewStyle()
5128 return new ViewStyle();
5132 /// Called after the View's ControlStates changed.
5134 /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
5135 [EditorBrowsable(EditorBrowsableState.Never)]
5136 protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
5142 [EditorBrowsable(EditorBrowsableState.Never)]
5143 protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
5145 isThemeChanged = true;
5146 if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
5147 else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
5148 isThemeChanged = false;
5152 /// Apply style instance to the view.
5153 /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
5155 /// <since_tizen> 9 </since_tizen>
5156 public virtual void ApplyStyle(ViewStyle viewStyle)
5158 if (viewStyle == null || themeData?.viewStyle == viewStyle) return;
5160 if (themeData == null) themeData = new ThemeData();
5162 themeData.viewStyle = viewStyle;
5164 if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
5170 BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
5172 if (bindablePropertyOfView == null)
5177 var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
5178 viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
5180 foreach (var sourceProperty in dirtyStyleProperties)
5182 var sourceValue = viewStyle.GetValue(sourceProperty);
5184 if (sourceValue == null)
5189 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
5191 // Do not set value again when theme is changed and the value has been set already.
5192 if (isThemeChanged && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty))
5197 if (destinationProperty != null)
5199 InternalSetValue(destinationProperty, sourceValue);
5205 /// Get whether the View is culled or not.
5206 /// True means that the View is out of the view frustum.
5209 /// Hidden-API (Inhouse-API).
5211 [EditorBrowsable(EditorBrowsableState.Never)]
5216 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.Culled);
5221 /// Set or Get TransitionOptions for the page transition.
5222 /// This property is used to define how this view will be transitioned during Page switching.
5224 /// <since_tizen> 9 </since_tizen>
5225 public TransitionOptions TransitionOptions
5229 if (NUIApplication.IsUsingXaml)
5231 return GetValue(TransitionOptionsProperty) as TransitionOptions;
5235 return GetInternalTransitionOptionsProperty(this) as TransitionOptions;
5240 if (NUIApplication.IsUsingXaml)
5242 SetValue(TransitionOptionsProperty, value);
5246 SetInternalTransitionOptionsProperty(this, null, value);
5248 NotifyPropertyChanged();
5252 private TransitionOptions InternalTransitionOptions
5256 transitionOptions = value;
5260 return transitionOptions;
5265 /// Called when the view is hit through TouchEvent or GestureEvent.
5266 /// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
5267 /// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
5268 /// User can override whether hit or not in HitTest.
5269 /// You can get the coordinates relative to tthe top-left of the hit view by touch.GetLocalPosition(0).
5270 /// or you can get the coordinates relative to the top-left of the screen by touch.GetScreenPosition(0).
5272 // <param name="touch"><see cref="Tizen.NUI.Touch"/>The touch data</param>
5273 [EditorBrowsable(EditorBrowsableState.Never)]
5274 protected virtual bool HitTest(Touch touch)
5280 /// Retrieve the View's current Color.
5283 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
5284 /// 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).
5285 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
5286 /// and users can get the current actual values through them.
5288 [EditorBrowsable(EditorBrowsableState.Never)]
5289 public Color CurrentColor => GetCurrentColor();
5292 /// Retrieve the current scale factor applied to the View.
5295 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
5296 /// 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).
5297 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
5298 /// and users can get the current actual values through them.
5300 [EditorBrowsable(EditorBrowsableState.Never)]
5301 public Vector3 CurrentScale => GetCurrentScale();
5304 /// Gets the number of currently alived View object.
5306 [EditorBrowsable(EditorBrowsableState.Never)]
5307 public static int AliveCount => aliveCount;
5310 /// Voice interaction name for voice touch.
5312 [EditorBrowsable(EditorBrowsableState.Never)]
5313 public string VoiceInteractionName
5317 AutomationId = value;
5321 return AutomationId;