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;
77 private Selector<ImageShadow> imageShadow;
78 private Selector<Shadow> boxShadow;
79 private Selector<string> backgroundImageSelector;
80 private Selector<float?> cornerRadius;
81 private Selector<float?> opacitySelector;
82 private Selector<Color> backgroundColorSelector;
83 private Selector<Rectangle> backgroundImageBorderSelector;
84 private Selector<Color> colorSelector;
88 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
89 [EditorBrowsable(EditorBrowsableState.Never)]
90 public 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(ViewStyle viewAttributes)
96 if (null != viewAttributes)
98 this.CopyFrom(viewAttributes);
103 /// Create an instance and set properties from the given view.
105 /// <param name="view">The View that includes property data.</param>
106 [EditorBrowsable(EditorBrowsableState.Never)]
107 public ViewStyle(View view)
109 CopyPropertiesFromView(view);
112 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
113 [EditorBrowsable(EditorBrowsableState.Never)]
114 public string StyleName
116 get => (string)GetValue(StyleNameProperty);
117 set => SetValue(StyleNameProperty, value);
120 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
121 [EditorBrowsable(EditorBrowsableState.Never)]
122 public Selector<string> BackgroundImage
126 Selector<string> image = (Selector<string>)GetValue(BackgroundImageSelectorProperty);
127 return (null != image) ? image : backgroundImageSelector = new Selector<string>();
129 set => SetValue(BackgroundImageSelectorProperty, 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 View.States? State
136 get => (View.States?)GetValue(StateProperty);
137 set => SetValue(StateProperty, value);
140 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
141 [EditorBrowsable(EditorBrowsableState.Never)]
142 public View.States? SubState
144 get => (View.States?)GetValue(SubStateProperty);
145 set => SetValue(SubStateProperty, value);
148 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
149 [EditorBrowsable(EditorBrowsableState.Never)]
152 get => (float?)GetValue(FlexProperty);
153 set => SetValue(FlexProperty, value);
156 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
157 [EditorBrowsable(EditorBrowsableState.Never)]
158 public int? AlignSelf
160 get => (int?)GetValue(AlignSelfProperty);
161 set => SetValue(AlignSelfProperty, value);
164 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
165 [EditorBrowsable(EditorBrowsableState.Never)]
166 public Vector4 FlexMargin
168 get => (Vector4)GetValue(FlexMarginProperty);
169 set => SetValue(FlexMarginProperty, value);
172 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
173 [EditorBrowsable(EditorBrowsableState.Never)]
174 public Vector2 CellIndex
176 get => (Vector2)GetValue(CellIndexProperty);
177 set => SetValue(CellIndexProperty, value);
180 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
181 [EditorBrowsable(EditorBrowsableState.Never)]
182 public float? RowSpan
184 get => (float?)GetValue(RowSpanProperty);
185 set => SetValue(RowSpanProperty, value);
188 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
189 [EditorBrowsable(EditorBrowsableState.Never)]
190 public float? ColumnSpan
192 get => (float?)GetValue(ColumnSpanProperty);
193 set => SetValue(ColumnSpanProperty, value);
196 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
197 [EditorBrowsable(EditorBrowsableState.Never)]
198 public HorizontalAlignmentType? CellHorizontalAlignment
200 get => (HorizontalAlignmentType?)GetValue(CellHorizontalAlignmentProperty);
201 set => SetValue(CellHorizontalAlignmentProperty, value);
204 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
205 [EditorBrowsable(EditorBrowsableState.Never)]
206 public VerticalAlignmentType? CellVerticalAlignment
208 get => (VerticalAlignmentType?)GetValue(CellVerticalAlignmentProperty);
209 set => SetValue(CellVerticalAlignmentProperty, value);
212 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
213 [EditorBrowsable(EditorBrowsableState.Never)]
214 public View LeftFocusableView
216 get => (View)GetValue(LeftFocusableViewProperty);
217 set => SetValue(LeftFocusableViewProperty, value);
220 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
221 [EditorBrowsable(EditorBrowsableState.Never)]
222 public View RightFocusableView
224 get => (View)GetValue(RightFocusableViewProperty);
225 set => SetValue(RightFocusableViewProperty, value);
228 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
229 [EditorBrowsable(EditorBrowsableState.Never)]
230 public View UpFocusableView
232 get => (View)GetValue(UpFocusableViewProperty);
233 set => SetValue(UpFocusableViewProperty, value);
236 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
237 [EditorBrowsable(EditorBrowsableState.Never)]
238 public View DownFocusableView
240 get => (View)GetValue(DownFocusableViewProperty);
241 set => SetValue(DownFocusableViewProperty, value);
244 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
245 [EditorBrowsable(EditorBrowsableState.Never)]
246 public bool? Focusable
248 get => (bool?)GetValue(FocusableProperty);
249 set => SetValue(FocusableProperty, value);
252 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
253 [EditorBrowsable(EditorBrowsableState.Never)]
256 get => (Size2D)GetValue(Size2DProperty);
257 set => SetValue(Size2DProperty, value);
260 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
261 [EditorBrowsable(EditorBrowsableState.Never)]
262 public Selector<float?> Opacity
266 Selector<float?> opacity = (Selector<float?>)GetValue(OpacitySelectorProperty);
267 return (null != opacity) ? opacity : opacitySelector = new Selector<float?>();
269 set => SetValue(OpacitySelectorProperty, 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 Position2D Position2D
276 get => (Position2D)GetValue(Position2DProperty);
277 set => SetValue(Position2DProperty, value);
280 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
281 [EditorBrowsable(EditorBrowsableState.Never)]
282 public bool? PositionUsesPivotPoint
284 get => (bool?)GetValue(PositionUsesPivotPointProperty);
285 set => SetValue(PositionUsesPivotPointProperty, value);
288 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
289 [EditorBrowsable(EditorBrowsableState.Never)]
290 public int? SiblingOrder
292 get => (int?)GetValue(SiblingOrderProperty);
293 set => SetValue(SiblingOrderProperty, value);
296 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
297 [EditorBrowsable(EditorBrowsableState.Never)]
298 public Position ParentOrigin
300 get => (Position)GetValue(ParentOriginProperty);
301 set => SetValue(ParentOriginProperty, value);
304 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
305 [EditorBrowsable(EditorBrowsableState.Never)]
306 public Position PivotPoint
308 get => (Position)GetValue(PivotPointProperty);
309 set => SetValue(PivotPointProperty, value);
312 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
313 [EditorBrowsable(EditorBrowsableState.Never)]
314 public float? SizeWidth
316 get => (float?)GetValue(SizeWidthProperty);
317 set => SetValue(SizeWidthProperty, value);
320 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
321 [EditorBrowsable(EditorBrowsableState.Never)]
322 public float? SizeHeight
324 get => (float?)GetValue(SizeHeightProperty);
325 set => SetValue(SizeHeightProperty, value);
328 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
329 [EditorBrowsable(EditorBrowsableState.Never)]
330 public Position Position
332 get => (Position)GetValue(PositionProperty);
333 set => SetValue(PositionProperty, value);
336 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
337 [EditorBrowsable(EditorBrowsableState.Never)]
338 public float? PositionX
340 get => (float?)GetValue(PositionXProperty);
341 set => SetValue(PositionXProperty, value);
344 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
345 [EditorBrowsable(EditorBrowsableState.Never)]
346 public float? PositionY
348 get => (float?)GetValue(PositionYProperty);
349 set => SetValue(PositionYProperty, value);
352 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
353 [EditorBrowsable(EditorBrowsableState.Never)]
354 public float? PositionZ
356 get => (float?)GetValue(PositionZProperty);
357 set => SetValue(PositionZProperty, value);
360 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
361 [EditorBrowsable(EditorBrowsableState.Never)]
362 public Rotation Orientation
364 get => (Rotation)GetValue(OrientationProperty);
365 set => SetValue(OrientationProperty, value);
368 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
369 [EditorBrowsable(EditorBrowsableState.Never)]
372 get => (Vector3)GetValue(ScaleProperty);
373 set => SetValue(ScaleProperty, value);
376 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
377 [EditorBrowsable(EditorBrowsableState.Never)]
380 get => (float?)GetValue(ScaleXProperty);
381 set => SetValue(ScaleXProperty, value);
384 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
385 [EditorBrowsable(EditorBrowsableState.Never)]
388 get => (float?)GetValue(ScaleYProperty);
389 set => SetValue(ScaleYProperty, value);
392 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
393 [EditorBrowsable(EditorBrowsableState.Never)]
396 get => (float?)GetValue(ScaleZProperty);
397 set => SetValue(ScaleZProperty, value);
400 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
401 [EditorBrowsable(EditorBrowsableState.Never)]
404 get => (string)GetValue(NameProperty);
405 set => SetValue(NameProperty, value);
408 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
409 [EditorBrowsable(EditorBrowsableState.Never)]
410 public bool? Sensitive
412 get => (bool?)GetValue(SensitiveProperty);
413 set => SetValue(SensitiveProperty, value);
416 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
417 [EditorBrowsable(EditorBrowsableState.Never)]
418 public bool? LeaveRequired
420 get => (bool?)GetValue(LeaveRequiredProperty);
421 set => SetValue(LeaveRequiredProperty, value);
424 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
425 [EditorBrowsable(EditorBrowsableState.Never)]
426 public bool? InheritOrientation
428 get => (bool?)GetValue(InheritOrientationProperty);
429 set => SetValue(InheritOrientationProperty, value);
432 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
433 [EditorBrowsable(EditorBrowsableState.Never)]
434 public bool? InheritScale
436 get => (bool?)GetValue(InheritScaleProperty);
437 set => SetValue(InheritScaleProperty, value);
440 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
441 [EditorBrowsable(EditorBrowsableState.Never)]
442 public DrawModeType? DrawMode
444 get => (DrawModeType?)GetValue(DrawModeProperty);
445 set => SetValue(DrawModeProperty, value);
448 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
449 [EditorBrowsable(EditorBrowsableState.Never)]
450 public Vector3 SizeModeFactor
452 get => (Vector3)GetValue(SizeModeFactorProperty);
453 set => SetValue(SizeModeFactorProperty, value);
456 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
457 [EditorBrowsable(EditorBrowsableState.Never)]
458 public ResizePolicyType? WidthResizePolicy
460 get => (ResizePolicyType?)GetValue(WidthResizePolicyProperty);
461 set => SetValue(WidthResizePolicyProperty, value);
464 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
465 [EditorBrowsable(EditorBrowsableState.Never)]
466 public ResizePolicyType? HeightResizePolicy
468 get => (ResizePolicyType?)GetValue(HeightResizePolicyProperty);
469 set => SetValue(HeightResizePolicyProperty, value);
472 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
473 [EditorBrowsable(EditorBrowsableState.Never)]
474 public SizeScalePolicyType? SizeScalePolicy
476 get => (SizeScalePolicyType?)GetValue(SizeScalePolicyProperty);
477 set => SetValue(SizeScalePolicyProperty, value);
480 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
481 [EditorBrowsable(EditorBrowsableState.Never)]
482 public bool? WidthForHeight
484 get => (bool?)GetValue(WidthForHeightProperty);
485 set => SetValue(WidthForHeightProperty, value);
488 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
489 [EditorBrowsable(EditorBrowsableState.Never)]
490 public bool? HeightForWidth
492 get => (bool?)GetValue(HeightForWidthProperty);
493 set => SetValue(HeightForWidthProperty, value);
496 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
497 [EditorBrowsable(EditorBrowsableState.Never)]
498 public Extents Padding
502 Extents tmp = (Extents)GetValue(PaddingProperty);
503 return (null != tmp) ? tmp : padding = new Extents(OnPaddingChanged, 0, 0, 0, 0);
505 set => SetValue(PaddingProperty, 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 Size2D MinimumSize
512 get => (Size2D)GetValue(MinimumSizeProperty);
513 set => SetValue(MinimumSizeProperty, value);
516 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
517 [EditorBrowsable(EditorBrowsableState.Never)]
518 public Size2D MaximumSize
520 get => (Size2D)GetValue(MaximumSizeProperty);
521 set => SetValue(MaximumSizeProperty, value);
524 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
525 [EditorBrowsable(EditorBrowsableState.Never)]
526 public bool? InheritPosition
528 get => (bool?)GetValue(InheritPositionProperty);
529 set => SetValue(InheritPositionProperty, value);
532 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
533 [EditorBrowsable(EditorBrowsableState.Never)]
534 public ClippingModeType? ClippingMode
536 get => (ClippingModeType?)GetValue(ClippingModeProperty);
537 set => SetValue(ClippingModeProperty, value);
540 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
541 [EditorBrowsable(EditorBrowsableState.Never)]
546 Size tmp = (Size)GetValue(SizeProperty);
547 return (null != tmp) ? tmp : size = new Size((float width, float height, float depth) => { Size = new Size(width, height, depth); }, 0, 0, 0);
549 set => SetValue(SizeProperty, 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)]
554 public bool? InheritLayoutDirection
556 get => (bool?)GetValue(InheritLayoutDirectionProperty);
557 set => SetValue(InheritLayoutDirectionProperty, value);
560 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
561 [EditorBrowsable(EditorBrowsableState.Never)]
562 public ViewLayoutDirectionType? LayoutDirection
564 get => (ViewLayoutDirectionType?)GetValue(LayoutDirectionProperty);
565 set => SetValue(LayoutDirectionProperty, value);
568 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
569 [EditorBrowsable(EditorBrowsableState.Never)]
570 public Extents Margin
574 Extents tmp = (Extents)GetValue(MarginProperty);
575 return (null != tmp) ? tmp : margin = new Extents(OnMarginChanged, 0, 0, 0, 0);
577 set => SetValue(MarginProperty, value);
580 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
581 [EditorBrowsable(EditorBrowsableState.Never)]
584 get => (float?)GetValue(WeightProperty);
585 set => SetValue(WeightProperty, value);
588 /// <summary> View BackgroundColor </summary>
589 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
590 [EditorBrowsable(EditorBrowsableState.Never)]
591 public Selector<Color> BackgroundColor
595 Selector<Color> color = (Selector<Color>)GetValue(BackgroundColorSelectorProperty);
596 return (null != color) ? color : backgroundColorSelector = new Selector<Color>();
598 set => SetValue(BackgroundColorSelectorProperty, value);
604 [EditorBrowsable(EditorBrowsableState.Never)]
605 public Selector<Color> Color
609 Selector<Color> color = (Selector<Color>)GetValue(ColorSelectorProperty);
610 return (null != color) ? color : colorSelector = new Selector<Color>();
612 set => SetValue(ColorSelectorProperty, value);
615 /// <summary>View BackgroundBorder</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<Rectangle> BackgroundImageBorder
622 Selector<Rectangle> border = (Selector<Rectangle>)GetValue(BackgroundImageBorderSelectorProperty);
623 return (null != border) ? border : backgroundImageBorderSelector = new Selector<Rectangle>();
625 set => SetValue(BackgroundImageBorderSelectorProperty, value);
629 /// Describes a shadow as an image for a View.
630 /// It is null by default.
633 /// If BoxShadow is not null, the ImageShadow value will be ignored.
635 [EditorBrowsable(EditorBrowsableState.Never)]
636 public Selector<ImageShadow> ImageShadow
638 get => (Selector<ImageShadow>)GetValue(ImageShadowSelectorProperty);
639 set => SetValue(ImageShadowSelectorProperty, value);
643 /// Describes a box shaped shadow drawing for a View.
644 /// It is null by default.
646 [EditorBrowsable(EditorBrowsableState.Never)]
647 public Selector<Shadow> BoxShadow
649 get => (Selector<Shadow>)GetValue(BoxShadowSelectorProperty);
650 set => SetValue(BoxShadowSelectorProperty, value);
654 /// The radius for the rounded corners of the View
656 [EditorBrowsable(EditorBrowsableState.Never)]
657 public Selector<float?> CornerRadius
659 get => (Selector<float?>)GetValue(CornerRadiusProperty);
660 set => SetValue(CornerRadiusProperty, value);
664 /// Set style's bindable properties from the view.
666 /// <param name="view">The view that includes property data.</param>
667 [EditorBrowsable(EditorBrowsableState.Never)]
668 public virtual void CopyPropertiesFromView(View view)
670 if (view == null) return;
672 BindableProperty.GetBindablePropertysOfType(GetType(), out var styleProperties);
673 BindableProperty.GetBindablePropertysOfType(view.GetType(), out var viewProperties);
676 if (styleProperties == null || viewProperties == null) return;
678 foreach (var stylePropertyItem in styleProperties)
680 viewProperties.TryGetValue(stylePropertyItem.Key, out var viewProperty);
682 if (viewProperty == null) continue;
684 SetValue(stylePropertyItem.Value, view.GetValue(viewProperty));
688 internal ViewStyle CreateInstance()
690 return (ViewStyle)Activator.CreateInstance(GetType());
693 internal ViewStyle Clone()
695 var cloned = CreateInstance();
696 cloned.CopyFrom(this);
701 private void OnPaddingChanged(ushort start, ushort end, ushort top, ushort bottom)
703 Padding = new Extents(start, end, top, bottom);
706 private void OnMarginChanged(ushort start, ushort end, ushort top, ushort bottom)
708 Margin = new Extents(start, end, top, bottom);