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 instance.InternalTextSelector = newValue as StringSelector;
161 defaultValueCreator: (bindable) =>
163 var instance = (Button)bindable;
164 return instance.InternalTextSelector;
168 /// TranslatableTextSelectorProperty
170 [EditorBrowsable(EditorBrowsableState.Never)]
171 public static readonly BindableProperty TranslatableTextSelectorProperty = BindableProperty.Create(nameof(TranslatableTextSelector), typeof(StringSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
173 var instance = (Button)bindable;
174 instance.InternalTranslatableTextSelector = newValue as StringSelector;
176 defaultValueCreator: (bindable) =>
178 var instance = (Button)bindable;
179 return instance.InternalTranslatableTextSelector;
183 /// TextColorSelectorProperty
185 [EditorBrowsable(EditorBrowsableState.Never)]
186 public static readonly BindableProperty TextColorSelectorProperty = BindableProperty.Create(nameof(TextColorSelector), typeof(ColorSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
188 var instance = (Button)bindable;
189 instance.InternalTextColorSelector = newValue as ColorSelector;
191 defaultValueCreator: (bindable) =>
193 var instance = (Button)bindable;
194 return instance.InternalTextColorSelector;
198 /// PointSizeSelectorProperty
200 [EditorBrowsable(EditorBrowsableState.Never)]
201 public static readonly BindableProperty PointSizeSelectorProperty = BindableProperty.Create(nameof(PointSizeSelector), typeof(FloatSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
203 var instance = (Button)bindable;
204 instance.InternalPointSizeSelector = newValue as FloatSelector;
206 defaultValueCreator: (bindable) =>
208 var instance = (Button)bindable;
209 return instance.InternalPointSizeSelector;
213 /// IconURLSelectorProperty
215 [EditorBrowsable(EditorBrowsableState.Never)]
216 public static readonly BindableProperty IconURLSelectorProperty = BindableProperty.Create(nameof(IconURLSelector), typeof(StringSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
218 var instance = (Button)bindable;
219 instance.InternalIconURLSelector = newValue as StringSelector;
221 defaultValueCreator: (bindable) =>
223 var instance = (Button)bindable;
224 return instance.InternalIconURLSelector;