2 * Copyright(c) 2020 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 Tizen.NUI.Binding;
22 namespace Tizen.NUI.BaseComponents
25 /// The base class for Children attributes in Components.
27 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
28 [EditorBrowsable(EditorBrowsableState.Never)]
29 public partial class ViewStyle : BindableObject, IDisposable
31 private bool disposed = false;
33 private string styleName;
34 private View.States? state;
35 private View.States? subState;
37 private int? alignSelf;
38 private Vector4 flexMargin;
39 private Vector2 cellIndex;
40 private float? rowSpan;
41 private float? columnSpan;
42 private HorizontalAlignmentType? cellHorizontalAlignment;
43 private VerticalAlignmentType? cellVerticalAlignment;
44 private View leftFocusableView;
45 private View rightFocusableView;
46 private View upFocusableView;
47 private View downFocusableView;
48 private bool? focusable;
49 private bool? positionUsesPivotPoint;
50 private int? siblingOrder;
51 private Position parentOrigin;
52 private Position pivotPoint;
53 private Position position;
54 private Rotation orientation;
55 private Vector3 scale;
57 private bool? sensitive;
58 private bool? leaveRequired;
59 private bool? inheritOrientation;
60 private bool? inheritScale;
61 private DrawModeType? drawMode;
62 private Vector3 sizeModeFactor;
63 private ResizePolicyType? widthResizePolicy;
64 private ResizePolicyType? heightResizePolicy;
65 private SizeScalePolicyType? sizeScalePolicy;
66 private bool? widthForHeight;
67 private bool? heightForWidth;
68 private Extents padding;
69 private Size2D minimumSize;
70 private Size2D maximumSize;
71 private bool? inheritPosition;
72 private ClippingModeType? clippingMode;
74 private bool? inheritLayoutDirection;
75 private ViewLayoutDirectionType? layoutDirection;
76 private Extents margin;
77 private float? weight;
78 private bool? enableControlState;
79 private bool? themeChangeSensitive;
81 private Selector<ImageShadow> imageShadow;
82 private Selector<Shadow> boxShadow;
83 private Selector<string> backgroundImageSelector;
84 private Selector<float?> cornerRadius;
85 private Selector<float?> opacitySelector;
86 private Selector<Color> backgroundColorSelector;
87 private Selector<Rectangle> backgroundImageBorderSelector;
88 private Selector<Color> colorSelector;
90 static ViewStyle() { }
92 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
93 [EditorBrowsable(EditorBrowsableState.Never)]
94 public ViewStyle() { }
97 /// destructor. This is HiddenAPI. recommended not to use in public.
99 [EditorBrowsable(EditorBrowsableState.Never)]
105 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
106 [EditorBrowsable(EditorBrowsableState.Never)]
107 public ViewStyle(ViewStyle viewAttributes)
109 CopyFrom(viewAttributes);
113 /// Create an instance and set properties from the given view.
115 /// <param name="view">The View that includes property data.</param>
116 [EditorBrowsable(EditorBrowsableState.Never)]
117 public ViewStyle(View view)
119 CopyPropertiesFromView(view);
122 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
123 [EditorBrowsable(EditorBrowsableState.Never)]
124 public string StyleName
126 get => (string)GetValue(StyleNameProperty);
127 set => SetValue(StyleNameProperty, value);
130 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
131 [EditorBrowsable(EditorBrowsableState.Never)]
132 public Selector<string> BackgroundImage
136 Selector<string> image = (Selector<string>)GetValue(BackgroundImageSelectorProperty);
137 return (null != image) ? image : backgroundImageSelector = new Selector<string>();
139 set => SetValue(BackgroundImageSelectorProperty, value);
142 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
143 [EditorBrowsable(EditorBrowsableState.Never)]
144 public View.States? State
146 get => (View.States?)GetValue(StateProperty);
147 set => SetValue(StateProperty, value);
150 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
151 [EditorBrowsable(EditorBrowsableState.Never)]
152 public View.States? SubState
154 get => (View.States?)GetValue(SubStateProperty);
155 set => SetValue(SubStateProperty, value);
158 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
159 [EditorBrowsable(EditorBrowsableState.Never)]
162 get => (float?)GetValue(FlexProperty);
163 set => SetValue(FlexProperty, value);
166 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
167 [EditorBrowsable(EditorBrowsableState.Never)]
168 public int? AlignSelf
170 get => (int?)GetValue(AlignSelfProperty);
171 set => SetValue(AlignSelfProperty, value);
174 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
175 [EditorBrowsable(EditorBrowsableState.Never)]
176 public Vector4 FlexMargin
178 get => (Vector4)GetValue(FlexMarginProperty);
179 set => SetValue(FlexMarginProperty, value);
182 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
183 [EditorBrowsable(EditorBrowsableState.Never)]
184 public Vector2 CellIndex
186 get => (Vector2)GetValue(CellIndexProperty);
187 set => SetValue(CellIndexProperty, value);
190 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
191 [EditorBrowsable(EditorBrowsableState.Never)]
192 public float? RowSpan
194 get => (float?)GetValue(RowSpanProperty);
195 set => SetValue(RowSpanProperty, value);
198 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
199 [EditorBrowsable(EditorBrowsableState.Never)]
200 public float? ColumnSpan
202 get => (float?)GetValue(ColumnSpanProperty);
203 set => SetValue(ColumnSpanProperty, value);
206 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
207 [EditorBrowsable(EditorBrowsableState.Never)]
208 public HorizontalAlignmentType? CellHorizontalAlignment
210 get => (HorizontalAlignmentType?)GetValue(CellHorizontalAlignmentProperty);
211 set => SetValue(CellHorizontalAlignmentProperty, value);
214 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
215 [EditorBrowsable(EditorBrowsableState.Never)]
216 public VerticalAlignmentType? CellVerticalAlignment
218 get => (VerticalAlignmentType?)GetValue(CellVerticalAlignmentProperty);
219 set => SetValue(CellVerticalAlignmentProperty, value);
222 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
223 [EditorBrowsable(EditorBrowsableState.Never)]
224 public View LeftFocusableView
226 get => (View)GetValue(LeftFocusableViewProperty);
227 set => SetValue(LeftFocusableViewProperty, value);
230 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
231 [EditorBrowsable(EditorBrowsableState.Never)]
232 public View RightFocusableView
234 get => (View)GetValue(RightFocusableViewProperty);
235 set => SetValue(RightFocusableViewProperty, value);
238 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
239 [EditorBrowsable(EditorBrowsableState.Never)]
240 public View UpFocusableView
242 get => (View)GetValue(UpFocusableViewProperty);
243 set => SetValue(UpFocusableViewProperty, value);
246 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
247 [EditorBrowsable(EditorBrowsableState.Never)]
248 public View DownFocusableView
250 get => (View)GetValue(DownFocusableViewProperty);
251 set => SetValue(DownFocusableViewProperty, value);
254 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
255 [EditorBrowsable(EditorBrowsableState.Never)]
256 public bool? Focusable
258 get => (bool?)GetValue(FocusableProperty);
259 set => SetValue(FocusableProperty, value);
262 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
263 [EditorBrowsable(EditorBrowsableState.Never)]
266 get => (Size2D)GetValue(Size2DProperty);
267 set => SetValue(Size2DProperty, value);
270 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
271 [EditorBrowsable(EditorBrowsableState.Never)]
272 public Selector<float?> Opacity
276 Selector<float?> opacity = (Selector<float?>)GetValue(OpacitySelectorProperty);
277 return (null != opacity) ? opacity : opacitySelector = new Selector<float?>();
279 set => SetValue(OpacitySelectorProperty, value);
282 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
283 [EditorBrowsable(EditorBrowsableState.Never)]
284 public Position2D Position2D
286 get => (Position2D)GetValue(Position2DProperty);
287 set => SetValue(Position2DProperty, value);
290 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
291 [EditorBrowsable(EditorBrowsableState.Never)]
292 public bool? PositionUsesPivotPoint
294 get => (bool?)GetValue(PositionUsesPivotPointProperty);
295 set => SetValue(PositionUsesPivotPointProperty, value);
298 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
299 [EditorBrowsable(EditorBrowsableState.Never)]
300 public int? SiblingOrder
302 get => (int?)GetValue(SiblingOrderProperty);
303 set => SetValue(SiblingOrderProperty, value);
306 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
307 [EditorBrowsable(EditorBrowsableState.Never)]
308 public Position ParentOrigin
310 get => (Position)GetValue(ParentOriginProperty);
311 set => SetValue(ParentOriginProperty, value);
314 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
315 [EditorBrowsable(EditorBrowsableState.Never)]
316 public Position PivotPoint
318 get => (Position)GetValue(PivotPointProperty);
319 set => SetValue(PivotPointProperty, value);
322 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
323 [EditorBrowsable(EditorBrowsableState.Never)]
324 public float? SizeWidth
326 get => (float?)GetValue(SizeWidthProperty);
327 set => SetValue(SizeWidthProperty, value);
330 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
331 [EditorBrowsable(EditorBrowsableState.Never)]
332 public float? SizeHeight
334 get => (float?)GetValue(SizeHeightProperty);
335 set => SetValue(SizeHeightProperty, value);
338 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
339 [EditorBrowsable(EditorBrowsableState.Never)]
340 public Position Position
342 get => (Position)GetValue(PositionProperty);
343 set => SetValue(PositionProperty, value);
346 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
347 [EditorBrowsable(EditorBrowsableState.Never)]
348 public float? PositionX
350 get => (float?)GetValue(PositionXProperty);
351 set => SetValue(PositionXProperty, value);
354 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
355 [EditorBrowsable(EditorBrowsableState.Never)]
356 public float? PositionY
358 get => (float?)GetValue(PositionYProperty);
359 set => SetValue(PositionYProperty, value);
362 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
363 [EditorBrowsable(EditorBrowsableState.Never)]
364 public float? PositionZ
366 get => (float?)GetValue(PositionZProperty);
367 set => SetValue(PositionZProperty, value);
370 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
371 [EditorBrowsable(EditorBrowsableState.Never)]
372 public Rotation Orientation
374 get => (Rotation)GetValue(OrientationProperty);
375 set => SetValue(OrientationProperty, value);
378 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
379 [EditorBrowsable(EditorBrowsableState.Never)]
382 get => (Vector3)GetValue(ScaleProperty);
383 set => SetValue(ScaleProperty, value);
386 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
387 [EditorBrowsable(EditorBrowsableState.Never)]
390 get => (float?)GetValue(ScaleXProperty);
391 set => SetValue(ScaleXProperty, value);
394 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
395 [EditorBrowsable(EditorBrowsableState.Never)]
398 get => (float?)GetValue(ScaleYProperty);
399 set => SetValue(ScaleYProperty, value);
402 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
403 [EditorBrowsable(EditorBrowsableState.Never)]
406 get => (float?)GetValue(ScaleZProperty);
407 set => SetValue(ScaleZProperty, value);
410 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
411 [EditorBrowsable(EditorBrowsableState.Never)]
414 get => (string)GetValue(NameProperty);
415 set => SetValue(NameProperty, value);
418 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
419 [EditorBrowsable(EditorBrowsableState.Never)]
420 public bool? Sensitive
422 get => (bool?)GetValue(SensitiveProperty);
423 set => SetValue(SensitiveProperty, value);
426 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
427 [EditorBrowsable(EditorBrowsableState.Never)]
428 public bool? LeaveRequired
430 get => (bool?)GetValue(LeaveRequiredProperty);
431 set => SetValue(LeaveRequiredProperty, value);
434 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
435 [EditorBrowsable(EditorBrowsableState.Never)]
436 public bool? InheritOrientation
438 get => (bool?)GetValue(InheritOrientationProperty);
439 set => SetValue(InheritOrientationProperty, value);
442 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
443 [EditorBrowsable(EditorBrowsableState.Never)]
444 public bool? InheritScale
446 get => (bool?)GetValue(InheritScaleProperty);
447 set => SetValue(InheritScaleProperty, value);
450 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
451 [EditorBrowsable(EditorBrowsableState.Never)]
452 public DrawModeType? DrawMode
454 get => (DrawModeType?)GetValue(DrawModeProperty);
455 set => SetValue(DrawModeProperty, value);
458 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
459 [EditorBrowsable(EditorBrowsableState.Never)]
460 public Vector3 SizeModeFactor
462 get => (Vector3)GetValue(SizeModeFactorProperty);
463 set => SetValue(SizeModeFactorProperty, value);
466 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
467 [EditorBrowsable(EditorBrowsableState.Never)]
468 public ResizePolicyType? WidthResizePolicy
470 get => (ResizePolicyType?)GetValue(WidthResizePolicyProperty);
471 set => SetValue(WidthResizePolicyProperty, value);
474 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
475 [EditorBrowsable(EditorBrowsableState.Never)]
476 public ResizePolicyType? HeightResizePolicy
478 get => (ResizePolicyType?)GetValue(HeightResizePolicyProperty);
479 set => SetValue(HeightResizePolicyProperty, value);
482 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
483 [EditorBrowsable(EditorBrowsableState.Never)]
484 public SizeScalePolicyType? SizeScalePolicy
486 get => (SizeScalePolicyType?)GetValue(SizeScalePolicyProperty);
487 set => SetValue(SizeScalePolicyProperty, value);
490 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
491 [EditorBrowsable(EditorBrowsableState.Never)]
492 public bool? WidthForHeight
494 get => (bool?)GetValue(WidthForHeightProperty);
495 set => SetValue(WidthForHeightProperty, value);
498 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
499 [EditorBrowsable(EditorBrowsableState.Never)]
500 public bool? HeightForWidth
502 get => (bool?)GetValue(HeightForWidthProperty);
503 set => SetValue(HeightForWidthProperty, value);
506 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
507 [EditorBrowsable(EditorBrowsableState.Never)]
508 public Extents Padding
512 Extents tmp = (Extents)GetValue(PaddingProperty);
513 return (null != tmp) ? tmp : padding = new Extents(OnPaddingChanged, 0, 0, 0, 0);
515 set => SetValue(PaddingProperty, value);
518 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
519 [EditorBrowsable(EditorBrowsableState.Never)]
520 public Size2D MinimumSize
522 get => (Size2D)GetValue(MinimumSizeProperty);
523 set => SetValue(MinimumSizeProperty, value);
526 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
527 [EditorBrowsable(EditorBrowsableState.Never)]
528 public Size2D MaximumSize
530 get => (Size2D)GetValue(MaximumSizeProperty);
531 set => SetValue(MaximumSizeProperty, value);
534 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
535 [EditorBrowsable(EditorBrowsableState.Never)]
536 public bool? InheritPosition
538 get => (bool?)GetValue(InheritPositionProperty);
539 set => SetValue(InheritPositionProperty, value);
542 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
543 [EditorBrowsable(EditorBrowsableState.Never)]
544 public ClippingModeType? ClippingMode
546 get => (ClippingModeType?)GetValue(ClippingModeProperty);
547 set => SetValue(ClippingModeProperty, value);
550 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
551 [EditorBrowsable(EditorBrowsableState.Never)]
556 Size tmp = (Size)GetValue(SizeProperty);
557 return (null != tmp) ? tmp : size = new Size((float? width, float? height, float? depth) =>
559 float targetWidth = 0;
560 float targetHeight = 0;
561 float targetDepth = 0;
565 targetWidth = size.Width;
566 targetHeight = size.Height;
567 targetDepth = size.Depth;
569 if (width != null) { targetWidth = (float)width; }
570 if (height != null) { targetHeight = (float)height; }
571 if (depth != null) { targetDepth = (float)depth; }
573 Size = new Size(targetWidth, targetHeight, targetDepth);
576 set => SetValue(SizeProperty, value);
579 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
580 [EditorBrowsable(EditorBrowsableState.Never)]
581 public bool? InheritLayoutDirection
583 get => (bool?)GetValue(InheritLayoutDirectionProperty);
584 set => SetValue(InheritLayoutDirectionProperty, value);
587 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
588 [EditorBrowsable(EditorBrowsableState.Never)]
589 public ViewLayoutDirectionType? LayoutDirection
591 get => (ViewLayoutDirectionType?)GetValue(LayoutDirectionProperty);
592 set => SetValue(LayoutDirectionProperty, value);
595 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
596 [EditorBrowsable(EditorBrowsableState.Never)]
597 public Extents Margin
601 Extents tmp = (Extents)GetValue(MarginProperty);
602 return (null != tmp) ? tmp : margin = new Extents(OnMarginChanged, 0, 0, 0, 0);
604 set => SetValue(MarginProperty, value);
607 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
608 [EditorBrowsable(EditorBrowsableState.Never)]
611 get => (float?)GetValue(WeightProperty);
612 set => SetValue(WeightProperty, value);
615 /// <summary> View BackgroundColor </summary>
616 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
617 [EditorBrowsable(EditorBrowsableState.Never)]
618 public Selector<Color> BackgroundColor
622 Selector<Color> color = (Selector<Color>)GetValue(BackgroundColorSelectorProperty);
623 return (null != color) ? color : backgroundColorSelector = new Selector<Color>();
625 set => SetValue(BackgroundColorSelectorProperty, value);
631 [EditorBrowsable(EditorBrowsableState.Never)]
632 public Selector<Color> Color
636 Selector<Color> color = (Selector<Color>)GetValue(ColorSelectorProperty);
637 return (null != color) ? color : colorSelector = new Selector<Color>();
639 set => SetValue(ColorSelectorProperty, value);
642 /// <summary>View BackgroundBorder</summary>
643 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
644 [EditorBrowsable(EditorBrowsableState.Never)]
645 public Selector<Rectangle> BackgroundImageBorder
649 Selector<Rectangle> border = (Selector<Rectangle>)GetValue(BackgroundImageBorderSelectorProperty);
650 return (null != border) ? border : backgroundImageBorderSelector = new Selector<Rectangle>();
652 set => SetValue(BackgroundImageBorderSelectorProperty, value);
656 /// Describes a shadow as an image for a View.
657 /// It is null by default.
660 /// If BoxShadow is not null, the ImageShadow value will be ignored.
662 [EditorBrowsable(EditorBrowsableState.Never)]
663 public Selector<ImageShadow> ImageShadow
665 get => (Selector<ImageShadow>)GetValue(ImageShadowSelectorProperty);
666 set => SetValue(ImageShadowSelectorProperty, value);
670 /// Describes a box shaped shadow drawing for a View.
671 /// It is null by default.
673 [EditorBrowsable(EditorBrowsableState.Never)]
674 public Selector<Shadow> BoxShadow
676 get => (Selector<Shadow>)GetValue(BoxShadowSelectorProperty);
677 set => SetValue(BoxShadowSelectorProperty, value);
681 /// The radius for the rounded corners of the View
683 [EditorBrowsable(EditorBrowsableState.Never)]
684 public Selector<float?> CornerRadius
686 get => (Selector<float?>)GetValue(CornerRadiusProperty);
687 set => SetValue(CornerRadiusProperty, value);
691 /// The EnableControlState value of the View.
693 [EditorBrowsable(EditorBrowsableState.Never)]
694 public bool? EnableControlState
696 get => (bool?)GetValue(EnableControlStateProperty);
697 set => SetValue(EnableControlStateProperty, value);
701 /// The ThemeChangeSensitive value of the View.
703 [EditorBrowsable(EditorBrowsableState.Never)]
704 public bool? ThemeChangeSensitive
706 get => (bool?)GetValue(ThemeChangeSensitiveProperty);
707 set => SetValue(ThemeChangeSensitiveProperty, value);
712 /// Allow null properties when merging it into other Theme.
713 /// If the value is true, the null properties reset target properties of the other ViewStyle with same key when merge.
714 /// It is used in <seealso cref="Theme.Merge(string)"/>, <seealso cref="Theme.Merge(Theme)"/>.
715 /// It is also used in <seealso cref="Theme.GetStyle(string)"/> when the Theme has a parent and needs to merge.
716 /// Please note that it is false by default.
718 [EditorBrowsable(EditorBrowsableState.Never)]
719 public bool SolidNull { get; set; } = false;
722 /// Set style's bindable properties from the view.
724 /// <param name="view">The view that includes property data.</param>
725 [EditorBrowsable(EditorBrowsableState.Never)]
726 public virtual void CopyPropertiesFromView(View view)
728 if (view == null) return;
730 BindableProperty.GetBindablePropertysOfType(GetType(), out var styleProperties);
731 BindableProperty.GetBindablePropertysOfType(view.GetType(), out var viewProperties);
734 if (styleProperties == null || viewProperties == null) return;
736 foreach (var stylePropertyItem in styleProperties)
738 viewProperties.TryGetValue(stylePropertyItem.Key, out var viewProperty);
740 if (viewProperty == null) continue;
742 SetValue(stylePropertyItem.Value, view.GetValue(viewProperty));
746 /// <summary>Create a cloned ViewStyle.</summary>
747 [EditorBrowsable(EditorBrowsableState.Never)]
748 public ViewStyle Clone()
750 var cloned = CreateInstance();
751 cloned.CopyFrom(this);
756 /// <summary>Create a cloned ViewStyle.</summary>
757 [EditorBrowsable(EditorBrowsableState.Never)]
758 public void Merge(ViewStyle other)
760 AllowNullCopy = other?.SolidNull ?? false;
762 AllowNullCopy = false;
765 internal ViewStyle CreateInstance()
767 return (ViewStyle)Activator.CreateInstance(GetType());
770 private void OnPaddingChanged(ushort start, ushort end, ushort top, ushort bottom)
772 Padding = new Extents(start, end, top, bottom);
775 private void OnMarginChanged(ushort start, ushort end, ushort top, ushort bottom)
777 Margin = new Extents(start, end, top, bottom);
781 /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
783 /// <param name="disposing">If true, disposes any disposable objects. If false, does not dispose disposable objects.</param>
784 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
785 [EditorBrowsable(EditorBrowsableState.Never)]
786 protected virtual void Dispose(bool disposing)
793 cellIndex?.Dispose();
794 downFocusableView?.Dispose();
795 flexMargin?.Dispose();
796 leftFocusableView?.Dispose();
798 maximumSize?.Dispose();
799 minimumSize?.Dispose();
800 orientation?.Dispose();
802 parentOrigin?.Dispose();
803 pivotPoint?.Dispose();
805 rightFocusableView?.Dispose();
808 sizeModeFactor?.Dispose();
809 upFocusableView?.Dispose();
815 /// Dispose the window resources
817 /// <returns></returns>
818 /// <since_tizen> 6 </since_tizen>
819 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
820 [EditorBrowsable(EditorBrowsableState.Never)]
821 public void Dispose()