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
31 private string styleName;
32 private View.States? state;
33 private View.States? subState;
35 private int? alignSelf;
36 private Vector4 flexMargin;
37 private Vector2 cellIndex;
38 private float? rowSpan;
39 private float? columnSpan;
40 private HorizontalAlignmentType? cellHorizontalAlignment;
41 private VerticalAlignmentType? cellVerticalAlignment;
42 private View leftFocusableView;
43 private View rightFocusableView;
44 private View upFocusableView;
45 private View downFocusableView;
46 private bool? focusable;
47 private bool? positionUsesPivotPoint;
48 private int? siblingOrder;
49 private Position parentOrigin;
50 private Position pivotPoint;
51 private Position position;
52 private Rotation orientation;
53 private Vector3 scale;
55 private bool? sensitive;
56 private bool? leaveRequired;
57 private bool? inheritOrientation;
58 private bool? inheritScale;
59 private DrawModeType? drawMode;
60 private Vector3 sizeModeFactor;
61 private ResizePolicyType? widthResizePolicy;
62 private ResizePolicyType? heightResizePolicy;
63 private SizeScalePolicyType? sizeScalePolicy;
64 private bool? widthForHeight;
65 private bool? heightForWidth;
66 private Extents padding;
67 private Size2D minimumSize;
68 private Size2D maximumSize;
69 private bool? inheritPosition;
70 private ClippingModeType? clippingMode;
72 private bool? inheritLayoutDirection;
73 private ViewLayoutDirectionType? layoutDirection;
74 private Extents margin;
75 private float? weight;
76 private bool? enableControlState;
78 private Selector<ImageShadow> imageShadow;
79 private Selector<Shadow> boxShadow;
80 private Selector<string> backgroundImageSelector;
81 private Selector<float?> cornerRadius;
82 private Selector<float?> opacitySelector;
83 private Selector<Color> backgroundColorSelector;
84 private Selector<Rectangle> backgroundImageBorderSelector;
85 private Selector<Color> colorSelector;
89 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
90 [EditorBrowsable(EditorBrowsableState.Never)]
91 public ViewStyle() { }
93 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
94 [EditorBrowsable(EditorBrowsableState.Never)]
95 public ViewStyle(ViewStyle viewAttributes)
97 if (null != viewAttributes)
99 this.CopyFrom(viewAttributes);
104 /// Create an instance and set properties from the given view.
106 /// <param name="view">The View that includes property data.</param>
107 [EditorBrowsable(EditorBrowsableState.Never)]
108 public ViewStyle(View view)
110 CopyPropertiesFromView(view);
113 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
114 [EditorBrowsable(EditorBrowsableState.Never)]
115 public string StyleName
117 get => (string)GetValue(StyleNameProperty);
118 set => SetValue(StyleNameProperty, value);
121 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
122 [EditorBrowsable(EditorBrowsableState.Never)]
123 public Selector<string> BackgroundImage
127 Selector<string> image = (Selector<string>)GetValue(BackgroundImageSelectorProperty);
128 return (null != image) ? image : backgroundImageSelector = new Selector<string>();
130 set => SetValue(BackgroundImageSelectorProperty, value);
133 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
134 [EditorBrowsable(EditorBrowsableState.Never)]
135 public View.States? State
137 get => (View.States?)GetValue(StateProperty);
138 set => SetValue(StateProperty, value);
141 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
142 [EditorBrowsable(EditorBrowsableState.Never)]
143 public View.States? SubState
145 get => (View.States?)GetValue(SubStateProperty);
146 set => SetValue(SubStateProperty, value);
149 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
150 [EditorBrowsable(EditorBrowsableState.Never)]
153 get => (float?)GetValue(FlexProperty);
154 set => SetValue(FlexProperty, value);
157 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
158 [EditorBrowsable(EditorBrowsableState.Never)]
159 public int? AlignSelf
161 get => (int?)GetValue(AlignSelfProperty);
162 set => SetValue(AlignSelfProperty, value);
165 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
166 [EditorBrowsable(EditorBrowsableState.Never)]
167 public Vector4 FlexMargin
169 get => (Vector4)GetValue(FlexMarginProperty);
170 set => SetValue(FlexMarginProperty, value);
173 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
174 [EditorBrowsable(EditorBrowsableState.Never)]
175 public Vector2 CellIndex
177 get => (Vector2)GetValue(CellIndexProperty);
178 set => SetValue(CellIndexProperty, value);
181 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
182 [EditorBrowsable(EditorBrowsableState.Never)]
183 public float? RowSpan
185 get => (float?)GetValue(RowSpanProperty);
186 set => SetValue(RowSpanProperty, value);
189 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
190 [EditorBrowsable(EditorBrowsableState.Never)]
191 public float? ColumnSpan
193 get => (float?)GetValue(ColumnSpanProperty);
194 set => SetValue(ColumnSpanProperty, value);
197 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
198 [EditorBrowsable(EditorBrowsableState.Never)]
199 public HorizontalAlignmentType? CellHorizontalAlignment
201 get => (HorizontalAlignmentType?)GetValue(CellHorizontalAlignmentProperty);
202 set => SetValue(CellHorizontalAlignmentProperty, value);
205 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
206 [EditorBrowsable(EditorBrowsableState.Never)]
207 public VerticalAlignmentType? CellVerticalAlignment
209 get => (VerticalAlignmentType?)GetValue(CellVerticalAlignmentProperty);
210 set => SetValue(CellVerticalAlignmentProperty, value);
213 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
214 [EditorBrowsable(EditorBrowsableState.Never)]
215 public View LeftFocusableView
217 get => (View)GetValue(LeftFocusableViewProperty);
218 set => SetValue(LeftFocusableViewProperty, value);
221 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
222 [EditorBrowsable(EditorBrowsableState.Never)]
223 public View RightFocusableView
225 get => (View)GetValue(RightFocusableViewProperty);
226 set => SetValue(RightFocusableViewProperty, value);
229 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
230 [EditorBrowsable(EditorBrowsableState.Never)]
231 public View UpFocusableView
233 get => (View)GetValue(UpFocusableViewProperty);
234 set => SetValue(UpFocusableViewProperty, value);
237 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
238 [EditorBrowsable(EditorBrowsableState.Never)]
239 public View DownFocusableView
241 get => (View)GetValue(DownFocusableViewProperty);
242 set => SetValue(DownFocusableViewProperty, value);
245 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
246 [EditorBrowsable(EditorBrowsableState.Never)]
247 public bool? Focusable
249 get => (bool?)GetValue(FocusableProperty);
250 set => SetValue(FocusableProperty, value);
253 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
254 [EditorBrowsable(EditorBrowsableState.Never)]
257 get => (Size2D)GetValue(Size2DProperty);
258 set => SetValue(Size2DProperty, value);
261 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
262 [EditorBrowsable(EditorBrowsableState.Never)]
263 public Selector<float?> Opacity
267 Selector<float?> opacity = (Selector<float?>)GetValue(OpacitySelectorProperty);
268 return (null != opacity) ? opacity : opacitySelector = new Selector<float?>();
270 set => SetValue(OpacitySelectorProperty, value);
273 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
274 [EditorBrowsable(EditorBrowsableState.Never)]
275 public Position2D Position2D
277 get => (Position2D)GetValue(Position2DProperty);
278 set => SetValue(Position2DProperty, value);
281 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
282 [EditorBrowsable(EditorBrowsableState.Never)]
283 public bool? PositionUsesPivotPoint
285 get => (bool?)GetValue(PositionUsesPivotPointProperty);
286 set => SetValue(PositionUsesPivotPointProperty, value);
289 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
290 [EditorBrowsable(EditorBrowsableState.Never)]
291 public int? SiblingOrder
293 get => (int?)GetValue(SiblingOrderProperty);
294 set => SetValue(SiblingOrderProperty, value);
297 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
298 [EditorBrowsable(EditorBrowsableState.Never)]
299 public Position ParentOrigin
301 get => (Position)GetValue(ParentOriginProperty);
302 set => SetValue(ParentOriginProperty, value);
305 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
306 [EditorBrowsable(EditorBrowsableState.Never)]
307 public Position PivotPoint
309 get => (Position)GetValue(PivotPointProperty);
310 set => SetValue(PivotPointProperty, value);
313 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
314 [EditorBrowsable(EditorBrowsableState.Never)]
315 public float? SizeWidth
317 get => (float?)GetValue(SizeWidthProperty);
318 set => SetValue(SizeWidthProperty, value);
321 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
322 [EditorBrowsable(EditorBrowsableState.Never)]
323 public float? SizeHeight
325 get => (float?)GetValue(SizeHeightProperty);
326 set => SetValue(SizeHeightProperty, value);
329 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
330 [EditorBrowsable(EditorBrowsableState.Never)]
331 public Position Position
333 get => (Position)GetValue(PositionProperty);
334 set => SetValue(PositionProperty, value);
337 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
338 [EditorBrowsable(EditorBrowsableState.Never)]
339 public float? PositionX
341 get => (float?)GetValue(PositionXProperty);
342 set => SetValue(PositionXProperty, value);
345 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
346 [EditorBrowsable(EditorBrowsableState.Never)]
347 public float? PositionY
349 get => (float?)GetValue(PositionYProperty);
350 set => SetValue(PositionYProperty, value);
353 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
354 [EditorBrowsable(EditorBrowsableState.Never)]
355 public float? PositionZ
357 get => (float?)GetValue(PositionZProperty);
358 set => SetValue(PositionZProperty, value);
361 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
362 [EditorBrowsable(EditorBrowsableState.Never)]
363 public Rotation Orientation
365 get => (Rotation)GetValue(OrientationProperty);
366 set => SetValue(OrientationProperty, value);
369 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
370 [EditorBrowsable(EditorBrowsableState.Never)]
373 get => (Vector3)GetValue(ScaleProperty);
374 set => SetValue(ScaleProperty, value);
377 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
378 [EditorBrowsable(EditorBrowsableState.Never)]
381 get => (float?)GetValue(ScaleXProperty);
382 set => SetValue(ScaleXProperty, value);
385 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
386 [EditorBrowsable(EditorBrowsableState.Never)]
389 get => (float?)GetValue(ScaleYProperty);
390 set => SetValue(ScaleYProperty, value);
393 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
394 [EditorBrowsable(EditorBrowsableState.Never)]
397 get => (float?)GetValue(ScaleZProperty);
398 set => SetValue(ScaleZProperty, value);
401 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
402 [EditorBrowsable(EditorBrowsableState.Never)]
405 get => (string)GetValue(NameProperty);
406 set => SetValue(NameProperty, value);
409 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
410 [EditorBrowsable(EditorBrowsableState.Never)]
411 public bool? Sensitive
413 get => (bool?)GetValue(SensitiveProperty);
414 set => SetValue(SensitiveProperty, value);
417 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
418 [EditorBrowsable(EditorBrowsableState.Never)]
419 public bool? LeaveRequired
421 get => (bool?)GetValue(LeaveRequiredProperty);
422 set => SetValue(LeaveRequiredProperty, value);
425 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
426 [EditorBrowsable(EditorBrowsableState.Never)]
427 public bool? InheritOrientation
429 get => (bool?)GetValue(InheritOrientationProperty);
430 set => SetValue(InheritOrientationProperty, value);
433 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
434 [EditorBrowsable(EditorBrowsableState.Never)]
435 public bool? InheritScale
437 get => (bool?)GetValue(InheritScaleProperty);
438 set => SetValue(InheritScaleProperty, value);
441 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
442 [EditorBrowsable(EditorBrowsableState.Never)]
443 public DrawModeType? DrawMode
445 get => (DrawModeType?)GetValue(DrawModeProperty);
446 set => SetValue(DrawModeProperty, value);
449 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
450 [EditorBrowsable(EditorBrowsableState.Never)]
451 public Vector3 SizeModeFactor
453 get => (Vector3)GetValue(SizeModeFactorProperty);
454 set => SetValue(SizeModeFactorProperty, value);
457 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
458 [EditorBrowsable(EditorBrowsableState.Never)]
459 public ResizePolicyType? WidthResizePolicy
461 get => (ResizePolicyType?)GetValue(WidthResizePolicyProperty);
462 set => SetValue(WidthResizePolicyProperty, value);
465 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
466 [EditorBrowsable(EditorBrowsableState.Never)]
467 public ResizePolicyType? HeightResizePolicy
469 get => (ResizePolicyType?)GetValue(HeightResizePolicyProperty);
470 set => SetValue(HeightResizePolicyProperty, value);
473 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
474 [EditorBrowsable(EditorBrowsableState.Never)]
475 public SizeScalePolicyType? SizeScalePolicy
477 get => (SizeScalePolicyType?)GetValue(SizeScalePolicyProperty);
478 set => SetValue(SizeScalePolicyProperty, value);
481 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
482 [EditorBrowsable(EditorBrowsableState.Never)]
483 public bool? WidthForHeight
485 get => (bool?)GetValue(WidthForHeightProperty);
486 set => SetValue(WidthForHeightProperty, value);
489 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
490 [EditorBrowsable(EditorBrowsableState.Never)]
491 public bool? HeightForWidth
493 get => (bool?)GetValue(HeightForWidthProperty);
494 set => SetValue(HeightForWidthProperty, value);
497 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
498 [EditorBrowsable(EditorBrowsableState.Never)]
499 public Extents Padding
503 Extents tmp = (Extents)GetValue(PaddingProperty);
504 return (null != tmp) ? tmp : padding = new Extents(OnPaddingChanged, 0, 0, 0, 0);
506 set => SetValue(PaddingProperty, value);
509 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
510 [EditorBrowsable(EditorBrowsableState.Never)]
511 public Size2D MinimumSize
513 get => (Size2D)GetValue(MinimumSizeProperty);
514 set => SetValue(MinimumSizeProperty, value);
517 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
518 [EditorBrowsable(EditorBrowsableState.Never)]
519 public Size2D MaximumSize
521 get => (Size2D)GetValue(MaximumSizeProperty);
522 set => SetValue(MaximumSizeProperty, value);
525 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
526 [EditorBrowsable(EditorBrowsableState.Never)]
527 public bool? InheritPosition
529 get => (bool?)GetValue(InheritPositionProperty);
530 set => SetValue(InheritPositionProperty, value);
533 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
534 [EditorBrowsable(EditorBrowsableState.Never)]
535 public ClippingModeType? ClippingMode
537 get => (ClippingModeType?)GetValue(ClippingModeProperty);
538 set => SetValue(ClippingModeProperty, value);
541 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
542 [EditorBrowsable(EditorBrowsableState.Never)]
547 Size tmp = (Size)GetValue(SizeProperty);
548 return (null != tmp) ? tmp : size = new Size((float? width, float? height, float? depth) =>
550 float targetWidth = 0;
551 float targetHeight = 0;
552 float targetDepth = 0;
556 targetWidth = size.Width;
557 targetHeight = size.Height;
558 targetDepth = size.Depth;
560 if (width != null) { targetWidth = (float)width; }
561 if (height != null) { targetHeight = (float)height; }
562 if (depth != null) { targetDepth = (float)depth; }
564 Size = new Size(targetWidth, targetHeight, targetDepth);
567 set => SetValue(SizeProperty, value);
570 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
571 [EditorBrowsable(EditorBrowsableState.Never)]
572 public bool? InheritLayoutDirection
574 get => (bool?)GetValue(InheritLayoutDirectionProperty);
575 set => SetValue(InheritLayoutDirectionProperty, value);
578 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
579 [EditorBrowsable(EditorBrowsableState.Never)]
580 public ViewLayoutDirectionType? LayoutDirection
582 get => (ViewLayoutDirectionType?)GetValue(LayoutDirectionProperty);
583 set => SetValue(LayoutDirectionProperty, value);
586 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
587 [EditorBrowsable(EditorBrowsableState.Never)]
588 public Extents Margin
592 Extents tmp = (Extents)GetValue(MarginProperty);
593 return (null != tmp) ? tmp : margin = new Extents(OnMarginChanged, 0, 0, 0, 0);
595 set => SetValue(MarginProperty, value);
598 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
599 [EditorBrowsable(EditorBrowsableState.Never)]
602 get => (float?)GetValue(WeightProperty);
603 set => SetValue(WeightProperty, value);
606 /// <summary> View BackgroundColor </summary>
607 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
608 [EditorBrowsable(EditorBrowsableState.Never)]
609 public Selector<Color> BackgroundColor
613 Selector<Color> color = (Selector<Color>)GetValue(BackgroundColorSelectorProperty);
614 return (null != color) ? color : backgroundColorSelector = new Selector<Color>();
616 set => SetValue(BackgroundColorSelectorProperty, value);
622 [EditorBrowsable(EditorBrowsableState.Never)]
623 public Selector<Color> Color
627 Selector<Color> color = (Selector<Color>)GetValue(ColorSelectorProperty);
628 return (null != color) ? color : colorSelector = new Selector<Color>();
630 set => SetValue(ColorSelectorProperty, value);
633 /// <summary>View BackgroundBorder</summary>
634 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
635 [EditorBrowsable(EditorBrowsableState.Never)]
636 public Selector<Rectangle> BackgroundImageBorder
640 Selector<Rectangle> border = (Selector<Rectangle>)GetValue(BackgroundImageBorderSelectorProperty);
641 return (null != border) ? border : backgroundImageBorderSelector = new Selector<Rectangle>();
643 set => SetValue(BackgroundImageBorderSelectorProperty, value);
647 /// Describes a shadow as an image for a View.
648 /// It is null by default.
651 /// If BoxShadow is not null, the ImageShadow value will be ignored.
653 [EditorBrowsable(EditorBrowsableState.Never)]
654 public Selector<ImageShadow> ImageShadow
656 get => (Selector<ImageShadow>)GetValue(ImageShadowSelectorProperty);
657 set => SetValue(ImageShadowSelectorProperty, value);
661 /// Describes a box shaped shadow drawing for a View.
662 /// It is null by default.
664 [EditorBrowsable(EditorBrowsableState.Never)]
665 public Selector<Shadow> BoxShadow
667 get => (Selector<Shadow>)GetValue(BoxShadowSelectorProperty);
668 set => SetValue(BoxShadowSelectorProperty, value);
672 /// The radius for the rounded corners of the View
674 [EditorBrowsable(EditorBrowsableState.Never)]
675 public Selector<float?> CornerRadius
677 get => (Selector<float?>)GetValue(CornerRadiusProperty);
678 set => SetValue(CornerRadiusProperty, value);
682 /// The EnableControlState value of the View.
684 [EditorBrowsable(EditorBrowsableState.Never)]
685 public bool? EnableControlState
687 get => (bool?)GetValue(EnableControlStateProperty);
688 set => SetValue(EnableControlStateProperty, value);
692 /// Set style's bindable properties from the view.
694 /// <param name="view">The view that includes property data.</param>
695 [EditorBrowsable(EditorBrowsableState.Never)]
696 public virtual void CopyPropertiesFromView(View view)
698 if (view == null) return;
700 BindableProperty.GetBindablePropertysOfType(GetType(), out var styleProperties);
701 BindableProperty.GetBindablePropertysOfType(view.GetType(), out var viewProperties);
704 if (styleProperties == null || viewProperties == null) return;
706 foreach (var stylePropertyItem in styleProperties)
708 viewProperties.TryGetValue(stylePropertyItem.Key, out var viewProperty);
710 if (viewProperty == null) continue;
712 SetValue(stylePropertyItem.Value, view.GetValue(viewProperty));
716 internal ViewStyle CreateInstance()
718 return (ViewStyle)Activator.CreateInstance(GetType());
721 internal ViewStyle Clone()
723 var cloned = CreateInstance();
724 cloned.CopyFrom(this);
729 private void OnPaddingChanged(ushort start, ushort end, ushort top, ushort bottom)
731 Padding = new Extents(start, end, top, bottom);
734 private void OnMarginChanged(ushort start, ushort end, ushort top, ushort bottom)
736 Margin = new Extents(start, end, top, bottom);