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;
80 private Selector<ImageShadow> imageShadow;
81 private Selector<Shadow> boxShadow;
82 private Selector<string> backgroundImageSelector;
83 private Selector<float?> cornerRadius;
84 private Selector<float?> opacitySelector;
85 private Selector<Color> backgroundColorSelector;
86 private Selector<Rectangle> backgroundImageBorderSelector;
87 private Selector<Color> colorSelector;
89 static ViewStyle() { }
91 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
92 [EditorBrowsable(EditorBrowsableState.Never)]
93 public ViewStyle() { }
96 /// destructor. This is HiddenAPI. recommended not to use in public.
98 [EditorBrowsable(EditorBrowsableState.Never)]
104 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
105 [EditorBrowsable(EditorBrowsableState.Never)]
106 public ViewStyle(ViewStyle viewAttributes)
108 if (null != viewAttributes)
110 this.CopyFrom(viewAttributes);
115 /// Create an instance and set properties from the given view.
117 /// <param name="view">The View that includes property data.</param>
118 [EditorBrowsable(EditorBrowsableState.Never)]
119 public ViewStyle(View view)
121 CopyPropertiesFromView(view);
124 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
125 [EditorBrowsable(EditorBrowsableState.Never)]
126 public string StyleName
128 get => (string)GetValue(StyleNameProperty);
129 set => SetValue(StyleNameProperty, value);
132 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
133 [EditorBrowsable(EditorBrowsableState.Never)]
134 public Selector<string> BackgroundImage
138 Selector<string> image = (Selector<string>)GetValue(BackgroundImageSelectorProperty);
139 return (null != image) ? image : backgroundImageSelector = new Selector<string>();
141 set => SetValue(BackgroundImageSelectorProperty, value);
144 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
145 [EditorBrowsable(EditorBrowsableState.Never)]
146 public View.States? State
148 get => (View.States?)GetValue(StateProperty);
149 set => SetValue(StateProperty, value);
152 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
153 [EditorBrowsable(EditorBrowsableState.Never)]
154 public View.States? SubState
156 get => (View.States?)GetValue(SubStateProperty);
157 set => SetValue(SubStateProperty, value);
160 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
161 [EditorBrowsable(EditorBrowsableState.Never)]
164 get => (float?)GetValue(FlexProperty);
165 set => SetValue(FlexProperty, value);
168 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
169 [EditorBrowsable(EditorBrowsableState.Never)]
170 public int? AlignSelf
172 get => (int?)GetValue(AlignSelfProperty);
173 set => SetValue(AlignSelfProperty, value);
176 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
177 [EditorBrowsable(EditorBrowsableState.Never)]
178 public Vector4 FlexMargin
180 get => (Vector4)GetValue(FlexMarginProperty);
181 set => SetValue(FlexMarginProperty, value);
184 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
185 [EditorBrowsable(EditorBrowsableState.Never)]
186 public Vector2 CellIndex
188 get => (Vector2)GetValue(CellIndexProperty);
189 set => SetValue(CellIndexProperty, value);
192 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
193 [EditorBrowsable(EditorBrowsableState.Never)]
194 public float? RowSpan
196 get => (float?)GetValue(RowSpanProperty);
197 set => SetValue(RowSpanProperty, value);
200 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
201 [EditorBrowsable(EditorBrowsableState.Never)]
202 public float? ColumnSpan
204 get => (float?)GetValue(ColumnSpanProperty);
205 set => SetValue(ColumnSpanProperty, value);
208 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
209 [EditorBrowsable(EditorBrowsableState.Never)]
210 public HorizontalAlignmentType? CellHorizontalAlignment
212 get => (HorizontalAlignmentType?)GetValue(CellHorizontalAlignmentProperty);
213 set => SetValue(CellHorizontalAlignmentProperty, value);
216 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
217 [EditorBrowsable(EditorBrowsableState.Never)]
218 public VerticalAlignmentType? CellVerticalAlignment
220 get => (VerticalAlignmentType?)GetValue(CellVerticalAlignmentProperty);
221 set => SetValue(CellVerticalAlignmentProperty, value);
224 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
225 [EditorBrowsable(EditorBrowsableState.Never)]
226 public View LeftFocusableView
228 get => (View)GetValue(LeftFocusableViewProperty);
229 set => SetValue(LeftFocusableViewProperty, value);
232 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
233 [EditorBrowsable(EditorBrowsableState.Never)]
234 public View RightFocusableView
236 get => (View)GetValue(RightFocusableViewProperty);
237 set => SetValue(RightFocusableViewProperty, value);
240 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
241 [EditorBrowsable(EditorBrowsableState.Never)]
242 public View UpFocusableView
244 get => (View)GetValue(UpFocusableViewProperty);
245 set => SetValue(UpFocusableViewProperty, value);
248 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
249 [EditorBrowsable(EditorBrowsableState.Never)]
250 public View DownFocusableView
252 get => (View)GetValue(DownFocusableViewProperty);
253 set => SetValue(DownFocusableViewProperty, value);
256 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
257 [EditorBrowsable(EditorBrowsableState.Never)]
258 public bool? Focusable
260 get => (bool?)GetValue(FocusableProperty);
261 set => SetValue(FocusableProperty, value);
264 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
265 [EditorBrowsable(EditorBrowsableState.Never)]
268 get => (Size2D)GetValue(Size2DProperty);
269 set => SetValue(Size2DProperty, value);
272 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
273 [EditorBrowsable(EditorBrowsableState.Never)]
274 public Selector<float?> Opacity
278 Selector<float?> opacity = (Selector<float?>)GetValue(OpacitySelectorProperty);
279 return (null != opacity) ? opacity : opacitySelector = new Selector<float?>();
281 set => SetValue(OpacitySelectorProperty, value);
284 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
285 [EditorBrowsable(EditorBrowsableState.Never)]
286 public Position2D Position2D
288 get => (Position2D)GetValue(Position2DProperty);
289 set => SetValue(Position2DProperty, value);
292 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
293 [EditorBrowsable(EditorBrowsableState.Never)]
294 public bool? PositionUsesPivotPoint
296 get => (bool?)GetValue(PositionUsesPivotPointProperty);
297 set => SetValue(PositionUsesPivotPointProperty, value);
300 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
301 [EditorBrowsable(EditorBrowsableState.Never)]
302 public int? SiblingOrder
304 get => (int?)GetValue(SiblingOrderProperty);
305 set => SetValue(SiblingOrderProperty, value);
308 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
309 [EditorBrowsable(EditorBrowsableState.Never)]
310 public Position ParentOrigin
312 get => (Position)GetValue(ParentOriginProperty);
313 set => SetValue(ParentOriginProperty, value);
316 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
317 [EditorBrowsable(EditorBrowsableState.Never)]
318 public Position PivotPoint
320 get => (Position)GetValue(PivotPointProperty);
321 set => SetValue(PivotPointProperty, value);
324 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
325 [EditorBrowsable(EditorBrowsableState.Never)]
326 public float? SizeWidth
328 get => (float?)GetValue(SizeWidthProperty);
329 set => SetValue(SizeWidthProperty, value);
332 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
333 [EditorBrowsable(EditorBrowsableState.Never)]
334 public float? SizeHeight
336 get => (float?)GetValue(SizeHeightProperty);
337 set => SetValue(SizeHeightProperty, value);
340 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
341 [EditorBrowsable(EditorBrowsableState.Never)]
342 public Position Position
344 get => (Position)GetValue(PositionProperty);
345 set => SetValue(PositionProperty, value);
348 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
349 [EditorBrowsable(EditorBrowsableState.Never)]
350 public float? PositionX
352 get => (float?)GetValue(PositionXProperty);
353 set => SetValue(PositionXProperty, value);
356 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
357 [EditorBrowsable(EditorBrowsableState.Never)]
358 public float? PositionY
360 get => (float?)GetValue(PositionYProperty);
361 set => SetValue(PositionYProperty, value);
364 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
365 [EditorBrowsable(EditorBrowsableState.Never)]
366 public float? PositionZ
368 get => (float?)GetValue(PositionZProperty);
369 set => SetValue(PositionZProperty, value);
372 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
373 [EditorBrowsable(EditorBrowsableState.Never)]
374 public Rotation Orientation
376 get => (Rotation)GetValue(OrientationProperty);
377 set => SetValue(OrientationProperty, value);
380 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
381 [EditorBrowsable(EditorBrowsableState.Never)]
384 get => (Vector3)GetValue(ScaleProperty);
385 set => SetValue(ScaleProperty, value);
388 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
389 [EditorBrowsable(EditorBrowsableState.Never)]
392 get => (float?)GetValue(ScaleXProperty);
393 set => SetValue(ScaleXProperty, value);
396 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
397 [EditorBrowsable(EditorBrowsableState.Never)]
400 get => (float?)GetValue(ScaleYProperty);
401 set => SetValue(ScaleYProperty, value);
404 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
405 [EditorBrowsable(EditorBrowsableState.Never)]
408 get => (float?)GetValue(ScaleZProperty);
409 set => SetValue(ScaleZProperty, value);
412 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
413 [EditorBrowsable(EditorBrowsableState.Never)]
416 get => (string)GetValue(NameProperty);
417 set => SetValue(NameProperty, value);
420 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
421 [EditorBrowsable(EditorBrowsableState.Never)]
422 public bool? Sensitive
424 get => (bool?)GetValue(SensitiveProperty);
425 set => SetValue(SensitiveProperty, value);
428 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
429 [EditorBrowsable(EditorBrowsableState.Never)]
430 public bool? LeaveRequired
432 get => (bool?)GetValue(LeaveRequiredProperty);
433 set => SetValue(LeaveRequiredProperty, value);
436 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
437 [EditorBrowsable(EditorBrowsableState.Never)]
438 public bool? InheritOrientation
440 get => (bool?)GetValue(InheritOrientationProperty);
441 set => SetValue(InheritOrientationProperty, value);
444 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
445 [EditorBrowsable(EditorBrowsableState.Never)]
446 public bool? InheritScale
448 get => (bool?)GetValue(InheritScaleProperty);
449 set => SetValue(InheritScaleProperty, value);
452 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
453 [EditorBrowsable(EditorBrowsableState.Never)]
454 public DrawModeType? DrawMode
456 get => (DrawModeType?)GetValue(DrawModeProperty);
457 set => SetValue(DrawModeProperty, value);
460 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
461 [EditorBrowsable(EditorBrowsableState.Never)]
462 public Vector3 SizeModeFactor
464 get => (Vector3)GetValue(SizeModeFactorProperty);
465 set => SetValue(SizeModeFactorProperty, value);
468 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
469 [EditorBrowsable(EditorBrowsableState.Never)]
470 public ResizePolicyType? WidthResizePolicy
472 get => (ResizePolicyType?)GetValue(WidthResizePolicyProperty);
473 set => SetValue(WidthResizePolicyProperty, value);
476 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
477 [EditorBrowsable(EditorBrowsableState.Never)]
478 public ResizePolicyType? HeightResizePolicy
480 get => (ResizePolicyType?)GetValue(HeightResizePolicyProperty);
481 set => SetValue(HeightResizePolicyProperty, value);
484 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
485 [EditorBrowsable(EditorBrowsableState.Never)]
486 public SizeScalePolicyType? SizeScalePolicy
488 get => (SizeScalePolicyType?)GetValue(SizeScalePolicyProperty);
489 set => SetValue(SizeScalePolicyProperty, value);
492 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
493 [EditorBrowsable(EditorBrowsableState.Never)]
494 public bool? WidthForHeight
496 get => (bool?)GetValue(WidthForHeightProperty);
497 set => SetValue(WidthForHeightProperty, value);
500 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
501 [EditorBrowsable(EditorBrowsableState.Never)]
502 public bool? HeightForWidth
504 get => (bool?)GetValue(HeightForWidthProperty);
505 set => SetValue(HeightForWidthProperty, value);
508 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
509 [EditorBrowsable(EditorBrowsableState.Never)]
510 public Extents Padding
514 Extents tmp = (Extents)GetValue(PaddingProperty);
515 return (null != tmp) ? tmp : padding = new Extents(OnPaddingChanged, 0, 0, 0, 0);
517 set => SetValue(PaddingProperty, value);
520 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
521 [EditorBrowsable(EditorBrowsableState.Never)]
522 public Size2D MinimumSize
524 get => (Size2D)GetValue(MinimumSizeProperty);
525 set => SetValue(MinimumSizeProperty, value);
528 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
529 [EditorBrowsable(EditorBrowsableState.Never)]
530 public Size2D MaximumSize
532 get => (Size2D)GetValue(MaximumSizeProperty);
533 set => SetValue(MaximumSizeProperty, value);
536 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
537 [EditorBrowsable(EditorBrowsableState.Never)]
538 public bool? InheritPosition
540 get => (bool?)GetValue(InheritPositionProperty);
541 set => SetValue(InheritPositionProperty, value);
544 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
545 [EditorBrowsable(EditorBrowsableState.Never)]
546 public ClippingModeType? ClippingMode
548 get => (ClippingModeType?)GetValue(ClippingModeProperty);
549 set => SetValue(ClippingModeProperty, value);
552 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
553 [EditorBrowsable(EditorBrowsableState.Never)]
558 Size tmp = (Size)GetValue(SizeProperty);
559 return (null != tmp) ? tmp : size = new Size((float? width, float? height, float? depth) =>
561 float targetWidth = 0;
562 float targetHeight = 0;
563 float targetDepth = 0;
567 targetWidth = size.Width;
568 targetHeight = size.Height;
569 targetDepth = size.Depth;
571 if (width != null) { targetWidth = (float)width; }
572 if (height != null) { targetHeight = (float)height; }
573 if (depth != null) { targetDepth = (float)depth; }
575 Size = new Size(targetWidth, targetHeight, targetDepth);
578 set => SetValue(SizeProperty, value);
581 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
582 [EditorBrowsable(EditorBrowsableState.Never)]
583 public bool? InheritLayoutDirection
585 get => (bool?)GetValue(InheritLayoutDirectionProperty);
586 set => SetValue(InheritLayoutDirectionProperty, value);
589 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
590 [EditorBrowsable(EditorBrowsableState.Never)]
591 public ViewLayoutDirectionType? LayoutDirection
593 get => (ViewLayoutDirectionType?)GetValue(LayoutDirectionProperty);
594 set => SetValue(LayoutDirectionProperty, value);
597 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
598 [EditorBrowsable(EditorBrowsableState.Never)]
599 public Extents Margin
603 Extents tmp = (Extents)GetValue(MarginProperty);
604 return (null != tmp) ? tmp : margin = new Extents(OnMarginChanged, 0, 0, 0, 0);
606 set => SetValue(MarginProperty, value);
609 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
610 [EditorBrowsable(EditorBrowsableState.Never)]
613 get => (float?)GetValue(WeightProperty);
614 set => SetValue(WeightProperty, value);
617 /// <summary> View BackgroundColor </summary>
618 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
619 [EditorBrowsable(EditorBrowsableState.Never)]
620 public Selector<Color> BackgroundColor
624 Selector<Color> color = (Selector<Color>)GetValue(BackgroundColorSelectorProperty);
625 return (null != color) ? color : backgroundColorSelector = new Selector<Color>();
627 set => SetValue(BackgroundColorSelectorProperty, value);
633 [EditorBrowsable(EditorBrowsableState.Never)]
634 public Selector<Color> Color
638 Selector<Color> color = (Selector<Color>)GetValue(ColorSelectorProperty);
639 return (null != color) ? color : colorSelector = new Selector<Color>();
641 set => SetValue(ColorSelectorProperty, value);
644 /// <summary>View BackgroundBorder</summary>
645 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
646 [EditorBrowsable(EditorBrowsableState.Never)]
647 public Selector<Rectangle> BackgroundImageBorder
651 Selector<Rectangle> border = (Selector<Rectangle>)GetValue(BackgroundImageBorderSelectorProperty);
652 return (null != border) ? border : backgroundImageBorderSelector = new Selector<Rectangle>();
654 set => SetValue(BackgroundImageBorderSelectorProperty, value);
658 /// Describes a shadow as an image for a View.
659 /// It is null by default.
662 /// If BoxShadow is not null, the ImageShadow value will be ignored.
664 [EditorBrowsable(EditorBrowsableState.Never)]
665 public Selector<ImageShadow> ImageShadow
667 get => (Selector<ImageShadow>)GetValue(ImageShadowSelectorProperty);
668 set => SetValue(ImageShadowSelectorProperty, value);
672 /// Describes a box shaped shadow drawing for a View.
673 /// It is null by default.
675 [EditorBrowsable(EditorBrowsableState.Never)]
676 public Selector<Shadow> BoxShadow
678 get => (Selector<Shadow>)GetValue(BoxShadowSelectorProperty);
679 set => SetValue(BoxShadowSelectorProperty, value);
683 /// The radius for the rounded corners of the View
685 [EditorBrowsable(EditorBrowsableState.Never)]
686 public Selector<float?> CornerRadius
688 get => (Selector<float?>)GetValue(CornerRadiusProperty);
689 set => SetValue(CornerRadiusProperty, value);
693 /// The EnableControlState value of the View.
695 [EditorBrowsable(EditorBrowsableState.Never)]
696 public bool? EnableControlState
698 get => (bool?)GetValue(EnableControlStateProperty);
699 set => SetValue(EnableControlStateProperty, value);
703 /// Set style's bindable properties from the view.
705 /// <param name="view">The view that includes property data.</param>
706 [EditorBrowsable(EditorBrowsableState.Never)]
707 public virtual void CopyPropertiesFromView(View view)
709 if (view == null) return;
711 BindableProperty.GetBindablePropertysOfType(GetType(), out var styleProperties);
712 BindableProperty.GetBindablePropertysOfType(view.GetType(), out var viewProperties);
715 if (styleProperties == null || viewProperties == null) return;
717 foreach (var stylePropertyItem in styleProperties)
719 viewProperties.TryGetValue(stylePropertyItem.Key, out var viewProperty);
721 if (viewProperty == null) continue;
723 SetValue(stylePropertyItem.Value, view.GetValue(viewProperty));
727 internal ViewStyle CreateInstance()
729 return (ViewStyle)Activator.CreateInstance(GetType());
732 internal ViewStyle Clone()
734 var cloned = CreateInstance();
735 cloned.CopyFrom(this);
740 private void OnPaddingChanged(ushort start, ushort end, ushort top, ushort bottom)
742 Padding = new Extents(start, end, top, bottom);
745 private void OnMarginChanged(ushort start, ushort end, ushort top, ushort bottom)
747 Margin = new Extents(start, end, top, bottom);
751 /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
753 /// <param name="disposing">If true, disposes any disposable objects. If false, does not dispose disposable objects.</param>
754 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
755 [EditorBrowsable(EditorBrowsableState.Never)]
756 protected virtual void Dispose(bool disposing)
763 cellIndex?.Dispose();
764 downFocusableView?.Dispose();
765 flexMargin?.Dispose();
766 leftFocusableView?.Dispose();
768 maximumSize?.Dispose();
769 minimumSize?.Dispose();
770 orientation?.Dispose();
772 parentOrigin?.Dispose();
773 pivotPoint?.Dispose();
775 rightFocusableView?.Dispose();
778 sizeModeFactor?.Dispose();
779 upFocusableView?.Dispose();
785 /// Dispose the window resources
787 /// <returns></returns>
788 /// <since_tizen> 6 </since_tizen>
789 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
790 [EditorBrowsable(EditorBrowsableState.Never)]
791 public void Dispose()