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.
17 using System.ComponentModel;
18 using Tizen.NUI.Binding;
20 namespace Tizen.NUI.BaseComponents
22 public partial class ViewStyle
24 /// <summary> Bindable property of BackgroundImage. Please do not open it. </summary>
25 [EditorBrowsable(EditorBrowsableState.Never)]
26 public static readonly BindableProperty BackgroundImageSelectorProperty = BindableProperty.Create("BackgroundImageSelector", typeof(Selector<string>), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
28 var viewStyle = (ViewStyle)bindable;
32 viewStyle.backgroundImageSelector = null;
36 viewStyle.backgroundImageSelector = (Selector<string>)newValue;
37 viewStyle.backgroundColorSelector = null;
40 defaultValueCreator: (bindable) =>
42 return ((ViewStyle)bindable).backgroundImageSelector;
45 /// <summary> Bindable property of Focusable. Please do not open it. </summary>
46 [EditorBrowsable(EditorBrowsableState.Never)]
47 public static readonly BindableProperty FocusableProperty = BindableProperty.Create(nameof(Focusable), typeof(bool?), typeof(ViewStyle), null,
48 propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).focusable = (bool?)newValue,
49 defaultValueCreator: (bindable) => ((ViewStyle)bindable).focusable
52 /// <summary> Bindable property of Focusable. Please do not open it. </summary>
53 [EditorBrowsable(EditorBrowsableState.Never)]
54 public static readonly BindableProperty Size2DProperty = BindableProperty.Create(nameof(Size2D), typeof(Size2D), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
56 var viewStyle = (ViewStyle)bindable;
57 viewStyle.size = newValue == null ? null : new Size((Size2D)newValue);
59 defaultValueCreator: (bindable) =>
61 var viewStyle = (ViewStyle)bindable;
62 return viewStyle.size == null ? null : (Size2D)viewStyle.size;
65 /// <summary> Bindable property of Opacity. Please do not open it. </summary>
66 [EditorBrowsable(EditorBrowsableState.Never)]
67 public static readonly BindableProperty OpacitySelectorProperty = BindableProperty.Create("OpacitySelector", typeof(Selector<float?>), typeof(ViewStyle), null,
68 propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).opacitySelector = (Selector<float?>)newValue,
69 defaultValueCreator: (bindable) => ((ViewStyle)bindable).opacitySelector
72 /// <summary> Bindable property of Position2D. Please do not open it. </summary>
73 [EditorBrowsable(EditorBrowsableState.Never)]
74 public static readonly BindableProperty Position2DProperty = BindableProperty.Create(nameof(Position2D), typeof(Position2D), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
76 var viewStyle = (ViewStyle)bindable;
77 viewStyle.position = newValue == null ? null : new Position((Position2D)newValue);
79 defaultValueCreator: (bindable) =>
81 var viewStyle = (ViewStyle)bindable;
82 return viewStyle.position == null ? null : new Position2D(viewStyle.position);
85 /// <summary> Bindable property of PositionUsesPivotPoint. Please do not open it. </summary>
86 [EditorBrowsable(EditorBrowsableState.Never)]
87 public static readonly BindableProperty PositionUsesPivotPointProperty = BindableProperty.Create(nameof(PositionUsesPivotPoint), typeof(bool?), typeof(ViewStyle), null,
88 propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).positionUsesPivotPoint = (bool?)newValue,
89 defaultValueCreator: (bindable) => ((ViewStyle)bindable).positionUsesPivotPoint
92 /// <summary> Bindable property of ParentOrigin. Please do not open it. </summary>
93 [EditorBrowsable(EditorBrowsableState.Never)]
94 public static readonly BindableProperty ParentOriginProperty = BindableProperty.Create(nameof(ParentOrigin), typeof(Position), typeof(ViewStyle), null,
95 propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).parentOrigin = (Position)newValue,
96 defaultValueCreator: (bindable) => ((ViewStyle)bindable).parentOrigin
99 /// <summary> Bindable property of PivotPoint. Please do not open it. </summary>
100 [EditorBrowsable(EditorBrowsableState.Never)]
101 public static readonly BindableProperty PivotPointProperty = BindableProperty.Create(nameof(PivotPoint), typeof(Position), typeof(ViewStyle), null,
102 propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).pivotPoint = (Position)newValue,
103 defaultValueCreator: (bindable) => ((ViewStyle)bindable).pivotPoint
106 /// <summary> Bindable property of SizeWidth. Please do not open it. </summary>
107 [EditorBrowsable(EditorBrowsableState.Never)]
108 public static readonly BindableProperty SizeWidthProperty = BindableProperty.Create(nameof(SizeWidth), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
110 var viewStyle = (ViewStyle)bindable;
111 if (newValue != null)
113 if (viewStyle.size == null)
115 if ((float)newValue == 0) return;
117 viewStyle.size = new Size((float)newValue, viewStyle.size?.Height ?? 0);
120 defaultValueCreator: (bindable) =>
122 return ((ViewStyle)bindable).size?.Width;
125 /// <summary> Bindable property of SizeHeight. Please do not open it. </summary>
126 [EditorBrowsable(EditorBrowsableState.Never)]
127 public static readonly BindableProperty SizeHeightProperty = BindableProperty.Create(nameof(SizeHeight), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
129 var viewStyle = (ViewStyle)bindable;
130 if (newValue != null)
132 if (viewStyle.size == null)
134 if ((float)newValue == 0) return;
136 viewStyle.size = new Size(viewStyle.size?.Width ?? 0, (float)newValue);
139 defaultValueCreator: (bindable) =>
141 return ((ViewStyle)bindable).size?.Height;
144 /// <summary> Bindable property of Position. Please do not open it. </summary>
145 [EditorBrowsable(EditorBrowsableState.Never)]
146 public static readonly BindableProperty PositionProperty = BindableProperty.Create(nameof(Position), typeof(Position), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
148 var viewStyle = (ViewStyle)bindable;
149 viewStyle.position = (Position)newValue;
150 if (viewStyle.position != null && viewStyle.position.X == 0 && viewStyle.position.Y == 0)
152 viewStyle.position = null;
155 defaultValueCreator: (bindable) =>
157 var viewStyle = (ViewStyle)bindable;
158 return viewStyle.position;
161 /// <summary> Bindable property of PositionX. Please do not open it. </summary>
162 [EditorBrowsable(EditorBrowsableState.Never)]
163 public static readonly BindableProperty PositionXProperty = BindableProperty.Create(nameof(PositionX), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
165 var viewStyle = (ViewStyle)bindable;
166 if (newValue != null)
168 if (viewStyle.position == null)
170 if ((float)newValue == 0) return;
172 viewStyle.position = new Position((float)newValue, viewStyle.position?.Y ?? 0);
175 defaultValueCreator: (bindable) =>
177 return ((ViewStyle)bindable).position?.X;
180 /// <summary> Bindable property of PositionY. Please do not open it. </summary>
181 [EditorBrowsable(EditorBrowsableState.Never)]
182 public static readonly BindableProperty PositionYProperty = BindableProperty.Create(nameof(PositionY), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
184 var viewStyle = (ViewStyle)bindable;
185 if (newValue != null)
187 if (viewStyle.position == null)
189 if ((float)newValue == 0) return;
191 viewStyle.position = new Position(viewStyle.position?.X ?? 0, (float)newValue);
194 defaultValueCreator: (bindable) =>
196 return ((ViewStyle)bindable).position?.Y;
199 /// <summary> Bindable property of Orientation. Please do not open it. </summary>
200 [EditorBrowsable(EditorBrowsableState.Never)]
201 public static readonly BindableProperty OrientationProperty = BindableProperty.Create(nameof(Orientation), typeof(Rotation), typeof(ViewStyle), null,
202 propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).orientation = (Rotation)newValue,
203 defaultValueCreator: (bindable) => ((ViewStyle)bindable).orientation
206 /// <summary> Bindable property of DrawMode. Please do not open it. </summary>
207 [EditorBrowsable(EditorBrowsableState.Never)]
208 public static readonly BindableProperty DrawModeProperty = BindableProperty.Create(nameof(DrawMode), typeof(DrawModeType?), typeof(ViewStyle), null,
209 propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).drawMode = (DrawModeType?)newValue,
210 defaultValueCreator: (bindable) => ((ViewStyle)bindable).drawMode
213 /// <summary> Bindable property of SizeModeFactor. Please do not open it. </summary>
214 [EditorBrowsable(EditorBrowsableState.Never)]
215 public static readonly BindableProperty SizeModeFactorProperty = BindableProperty.Create(nameof(SizeModeFactor), typeof(Vector3), typeof(ViewStyle), null,
216 propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).sizeModeFactor = (Vector3)newValue,
217 defaultValueCreator: (bindable) => ((ViewStyle)bindable).sizeModeFactor
220 /// <summary> Bindable property of WidthResizePolicy. Please do not open it. </summary>
221 [EditorBrowsable(EditorBrowsableState.Never)]
222 public static readonly BindableProperty WidthResizePolicyProperty = BindableProperty.Create(nameof(WidthResizePolicy), typeof(ResizePolicyType?), typeof(ViewStyle), null,
223 propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).widthResizePolicy = (ResizePolicyType?)newValue,
224 defaultValueCreator: (bindable) => ((ViewStyle)bindable).widthResizePolicy
227 /// <summary> Bindable property of HeightResizePolicy. Please do not open it. </summary>
228 [EditorBrowsable(EditorBrowsableState.Never)]
229 public static readonly BindableProperty HeightResizePolicyProperty = BindableProperty.Create(nameof(HeightResizePolicy), typeof(ResizePolicyType?), typeof(ViewStyle), null,
230 propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).heightResizePolicy = (ResizePolicyType?)newValue,
231 defaultValueCreator: (bindable) => ((ViewStyle)bindable).heightResizePolicy
234 /// <summary> Bindable property of WidthForHeight. Please do not open it. </summary>
235 [EditorBrowsable(EditorBrowsableState.Never)]
236 public static readonly BindableProperty WidthForHeightProperty = BindableProperty.Create(nameof(WidthForHeight), typeof(bool?), typeof(ViewStyle), null,
237 propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).widthForHeight = (bool?)newValue,
238 defaultValueCreator: (bindable) => ((ViewStyle)bindable).widthForHeight
241 /// <summary> Bindable property of HeightForWidth. Please do not open it. </summary>
242 [EditorBrowsable(EditorBrowsableState.Never)]
243 public static readonly BindableProperty HeightForWidthProperty = BindableProperty.Create(nameof(HeightForWidth), typeof(bool?), typeof(ViewStyle), null,
244 propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).heightForWidth = (bool?)newValue,
245 defaultValueCreator: (bindable) => ((ViewStyle)bindable).heightForWidth
248 /// <summary> Bindable property of Padding. Please do not open it. </summary>
249 [EditorBrowsable(EditorBrowsableState.Never)]
250 public static readonly BindableProperty PaddingProperty = BindableProperty.Create(nameof(Padding), typeof(Extents), typeof(ViewStyle), null,
251 propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).padding = (Extents)newValue,
252 defaultValueCreator: (bindable) => ((ViewStyle)bindable).padding
255 /// <summary> Bindable property of MinimumSize. Please do not open it. </summary>
256 [EditorBrowsable(EditorBrowsableState.Never)]
257 public static readonly BindableProperty MinimumSizeProperty = BindableProperty.Create(nameof(MinimumSize), typeof(Size2D), typeof(ViewStyle), null,
258 propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).minimumSize = (Size2D)newValue,
259 defaultValueCreator: (bindable) => ((ViewStyle)bindable).minimumSize
262 /// <summary> Bindable property of MaximumSize. Please do not open it. </summary>
263 [EditorBrowsable(EditorBrowsableState.Never)]
264 public static readonly BindableProperty MaximumSizeProperty = BindableProperty.Create(nameof(MaximumSize), typeof(Size2D), typeof(ViewStyle), null,
265 propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).maximumSize = (Size2D)newValue,
266 defaultValueCreator: (bindable) => ((ViewStyle)bindable).maximumSize
269 /// <summary> Bindable property of ClippingMode. Please do not open it. </summary>
270 [EditorBrowsable(EditorBrowsableState.Never)]
271 public static readonly BindableProperty ClippingModeProperty = BindableProperty.Create(nameof(ClippingMode), typeof(ClippingModeType?), typeof(ViewStyle), null,
272 propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).clippingMode = (ClippingModeType?)newValue,
273 defaultValueCreator: (bindable) => ((ViewStyle)bindable).clippingMode
276 /// <summary> Bindable property of Size. Please do not open it. </summary>
277 [EditorBrowsable(EditorBrowsableState.Never)]
278 public static readonly BindableProperty SizeProperty = BindableProperty.Create(nameof(Size), typeof(Size), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
280 var viewStyle = (ViewStyle)bindable;
281 viewStyle.size = (Size)newValue;
282 if (viewStyle.size != null && viewStyle.size.Width == 0 && viewStyle.size.Height == 0)
284 viewStyle.size = null;
287 defaultValueCreator: (bindable) =>
289 var viewStyle = (ViewStyle)bindable;
290 return viewStyle.size;
293 /// <summary> Bindable property of Margin. Please do not open it. </summary>
294 [EditorBrowsable(EditorBrowsableState.Never)]
295 public static readonly BindableProperty MarginProperty = BindableProperty.Create(nameof(Margin), typeof(Extents), typeof(ViewStyle), null,
296 propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).margin = (Extents)newValue,
297 defaultValueCreator: (bindable) => ((ViewStyle)bindable).margin
300 /// <summary> Bindable property of BackgroundColor. Please do not open it. </summary>
301 [EditorBrowsable(EditorBrowsableState.Never)]
302 public static readonly BindableProperty BackgroundColorSelectorProperty = BindableProperty.Create("BackgroundColorSelector", typeof(Selector<Color>), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
304 var viewStyle = (ViewStyle)bindable;
306 if (newValue == null)
308 viewStyle.backgroundColorSelector = null;
312 viewStyle.backgroundColorSelector = (Selector<Color>)newValue;
313 viewStyle.backgroundImageSelector = null;
317 defaultValueCreator: (bindable) =>
319 return ((ViewStyle)bindable).backgroundColorSelector;
322 /// <summary> Bindable property of ColorSelector. Please do not open it. </summary>
323 [EditorBrowsable(EditorBrowsableState.Never)]
324 public static readonly BindableProperty ColorSelectorProperty = BindableProperty.Create("ColorSelector", typeof(Selector<Color>), typeof(ViewStyle), null,
325 propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).colorSelector = (Selector<Color>)newValue,
326 defaultValueCreator: (bindable) => ((ViewStyle)bindable).colorSelector
329 /// <summary> Bindable property of BackgroundImageBorder. Please do not open it. </summary>
330 [EditorBrowsable(EditorBrowsableState.Never)]
331 public static readonly BindableProperty BackgroundImageBorderSelectorProperty = BindableProperty.Create("BackgroundImageBorderSelector", typeof(Selector<Rectangle>), typeof(ViewStyle), null,
332 propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).backgroundImageBorderSelector = (Selector<Rectangle>)newValue,
333 defaultValueCreator: (bindable) => ((ViewStyle)bindable).backgroundImageBorderSelector
336 /// <summary> Bindable property of ImageShadow. Please do not open it. </summary>
337 [EditorBrowsable(EditorBrowsableState.Never)]
338 public static readonly BindableProperty ImageShadowSelectorProperty = BindableProperty.Create("ImageShadowSelector", typeof(Selector<ImageShadow>), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
340 var viewStyle = (ViewStyle)bindable;
342 viewStyle.imageShadow = (Selector<ImageShadow>)newValue;
344 if (viewStyle.imageShadow != null)
346 viewStyle.boxShadow = null;
349 defaultValueCreator: (bindable) =>
351 var viewStyle = (ViewStyle)bindable;
352 return ((ViewStyle)bindable).imageShadow;
355 /// <summary> Bindable property of BoxShadow. Please do not open it. </summary>
356 [EditorBrowsable(EditorBrowsableState.Never)]
357 public static readonly BindableProperty BoxShadowSelectorProperty = BindableProperty.Create("BoxShadowSelector", typeof(Selector<Shadow>), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
359 var viewStyle = (ViewStyle)bindable;
361 viewStyle.boxShadow = (Selector<Shadow>)newValue;
363 if (viewStyle.boxShadow != null)
365 viewStyle.imageShadow = null;
368 defaultValueCreator: (bindable) =>
370 var viewStyle = (ViewStyle)bindable;
371 return ((ViewStyle)bindable).boxShadow;
374 /// <summary> Bindable property of CornerRadius. Please do not open it. </summary>
375 [EditorBrowsable(EditorBrowsableState.Never)]
376 public static readonly BindableProperty CornerRadiusProperty = BindableProperty.Create(nameof(CornerRadius), typeof(Vector4), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
378 ((ViewStyle)bindable).cornerRadius = (Vector4)newValue;
379 }, defaultValueCreator: (bindable) => ((ViewStyle)bindable).cornerRadius);
381 /// <summary> Bindable property of CornerRadiusPolicy. Please do not open it. </summary>
382 [EditorBrowsable(EditorBrowsableState.Never)]
383 public static readonly BindableProperty CornerRadiusPolicyProperty = BindableProperty.Create(nameof(CornerRadiusPolicy), typeof(VisualTransformPolicyType?), typeof(ViewStyle), null,
384 propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).cornerRadiusPolicy = (VisualTransformPolicyType?)newValue,
385 defaultValueCreator: (bindable) => ((ViewStyle)bindable).cornerRadiusPolicy
388 /// <summary> Bindable property of ThemeChangeSensitive. Please do not open it. </summary>
389 [EditorBrowsable(EditorBrowsableState.Never)]
390 public static readonly BindableProperty ThemeChangeSensitiveProperty = BindableProperty.Create(nameof(ThemeChangeSensitive), typeof(bool?), typeof(ViewStyle), null,
391 propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).themeChangeSensitive = (bool?)newValue,
392 defaultValueCreator: (bindable) => ((ViewStyle)bindable).themeChangeSensitive