1 using System.ComponentModel;
2 using Tizen.NUI.Binding;
4 namespace Tizen.NUI.Components
6 public partial class Button
11 [EditorBrowsable(EditorBrowsableState.Never)]
12 public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(Button), default(string), propertyChanged: (bindable, oldValue, newValue) =>
14 var instance = (Button)bindable;
17 instance.InternalText = newValue as string;
20 defaultValueCreator: (bindable) =>
22 var instance = (Button)bindable;
23 return instance.InternalText;
27 /// TranslatableTextProperty
29 [EditorBrowsable(EditorBrowsableState.Never)]
30 public static readonly BindableProperty TranslatableTextProperty = BindableProperty.Create(nameof(TranslatableText), typeof(string), typeof(Button), default(string), propertyChanged: (bindable, oldValue, newValue) =>
32 var instance = (Button)bindable;
35 instance.InternalTranslatableText = newValue as string;
38 defaultValueCreator: (bindable) =>
40 var instance = (Button)bindable;
41 return instance.InternalTranslatableText;
47 [EditorBrowsable(EditorBrowsableState.Never)]
48 public static readonly BindableProperty PointSizeProperty = BindableProperty.Create(nameof(PointSize), typeof(float), typeof(Button), default(float), propertyChanged: (bindable, oldValue, newValue) =>
50 var instance = (Button)bindable;
53 instance.InternalPointSize = (float)newValue;
56 defaultValueCreator: (bindable) =>
58 var instance = (Button)bindable;
59 return instance.InternalPointSize;
63 /// FontFamilyProperty
65 [EditorBrowsable(EditorBrowsableState.Never)]
66 public static readonly BindableProperty FontFamilyProperty = BindableProperty.Create(nameof(FontFamily), typeof(string), typeof(Button), default(string), propertyChanged: (bindable, oldValue, newValue) =>
68 var instance = (Button)bindable;
71 instance.InternalFontFamily = newValue as string;
74 defaultValueCreator: (bindable) =>
76 var instance = (Button)bindable;
77 return instance.InternalFontFamily;
83 [EditorBrowsable(EditorBrowsableState.Never)]
84 public static readonly BindableProperty TextColorProperty = BindableProperty.Create(nameof(TextColor), typeof(Color), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
86 var instance = (Button)bindable;
89 instance.InternalTextColor = newValue as Color;
92 defaultValueCreator: (bindable) =>
94 var instance = (Button)bindable;
95 return instance.InternalTextColor;
99 /// TextAlignmentProperty
101 [EditorBrowsable(EditorBrowsableState.Never)]
102 public static readonly BindableProperty TextAlignmentProperty = BindableProperty.Create(nameof(TextAlignment), typeof(HorizontalAlignment), typeof(Button), default(HorizontalAlignment), propertyChanged: (bindable, oldValue, newValue) =>
104 var instance = (Button)bindable;
105 if (newValue != null)
107 instance.InternalTextAlignment = (HorizontalAlignment)newValue;
110 defaultValueCreator: (bindable) =>
112 var instance = (Button)bindable;
113 return instance.InternalTextAlignment;
119 [EditorBrowsable(EditorBrowsableState.Never)]
120 public static readonly BindableProperty IconURLProperty = BindableProperty.Create(nameof(IconURL), typeof(string), typeof(Button), default(string), propertyChanged: (bindable, oldValue, newValue) =>
122 var instance = (Button)bindable;
123 if (newValue != null)
125 instance.InternalIconURL = newValue as string;
128 defaultValueCreator: (bindable) =>
130 var instance = (Button)bindable;
131 return instance.InternalIconURL;
137 [EditorBrowsable(EditorBrowsableState.Never)]
138 public static readonly BindableProperty IconSizeProperty = BindableProperty.Create(nameof(IconSize), typeof(Size), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
140 var instance = (Button)bindable;
141 if (newValue != null)
143 instance.InternalIconSize = newValue as Size;
146 defaultValueCreator: (bindable) =>
148 var instance = (Button)bindable;
149 return instance.InternalIconSize;
153 /// TextSelectorProperty
155 [EditorBrowsable(EditorBrowsableState.Never)]
156 public static readonly BindableProperty TextSelectorProperty = BindableProperty.Create(nameof(TextSelector), typeof(StringSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
158 var instance = (Button)bindable;
159 if (newValue != null)
161 instance.InternalTextSelector = newValue as StringSelector;
164 defaultValueCreator: (bindable) =>
166 var instance = (Button)bindable;
167 return instance.InternalTextSelector;
171 /// TranslatableTextSelectorProperty
173 [EditorBrowsable(EditorBrowsableState.Never)]
174 public static readonly BindableProperty TranslatableTextSelectorProperty = BindableProperty.Create(nameof(TranslatableTextSelector), typeof(StringSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
176 var instance = (Button)bindable;
177 if (newValue != null)
179 instance.InternalTranslatableTextSelector = newValue as StringSelector;
182 defaultValueCreator: (bindable) =>
184 var instance = (Button)bindable;
185 return instance.InternalTranslatableTextSelector;
189 /// TextColorSelectorProperty
191 [EditorBrowsable(EditorBrowsableState.Never)]
192 public static readonly BindableProperty TextColorSelectorProperty = BindableProperty.Create(nameof(TextColorSelector), typeof(ColorSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
194 var instance = (Button)bindable;
195 if (newValue != null)
197 instance.InternalTextColorSelector = newValue as ColorSelector;
200 defaultValueCreator: (bindable) =>
202 var instance = (Button)bindable;
203 return instance.InternalTextColorSelector;
207 /// PointSizeSelectorProperty
209 [EditorBrowsable(EditorBrowsableState.Never)]
210 public static readonly BindableProperty PointSizeSelectorProperty = BindableProperty.Create(nameof(PointSizeSelector), typeof(FloatSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
212 var instance = (Button)bindable;
213 if (newValue != null)
215 instance.InternalPointSizeSelector = newValue as FloatSelector;
218 defaultValueCreator: (bindable) =>
220 var instance = (Button)bindable;
221 return instance.InternalPointSizeSelector;
225 /// IconURLSelectorProperty
227 [EditorBrowsable(EditorBrowsableState.Never)]
228 public static readonly BindableProperty IconURLSelectorProperty = BindableProperty.Create(nameof(IconURLSelector), typeof(StringSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
230 var instance = (Button)bindable;
231 if (newValue != null)
233 instance.InternalIconURLSelector = newValue as StringSelector;
236 defaultValueCreator: (bindable) =>
238 var instance = (Button)bindable;
239 return instance.InternalIconURLSelector;