9c35857e2781b9ce1374b5381a2ca6d4dad9bc53
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Controls / ButtonBindableProperty.cs
1 using System.ComponentModel;
2 using Tizen.NUI.Binding;
3
4 namespace Tizen.NUI.Components
5 {
6     public partial class Button
7     {
8         /// <summary>
9         /// TextProperty
10         /// </summary>
11         [EditorBrowsable(EditorBrowsableState.Never)]
12         public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(Button), default(string), propertyChanged: (bindable, oldValue, newValue) =>
13         {
14             var instance = (Button)bindable;
15             if (newValue != null)
16             {
17                 instance.InternalText = newValue as string;
18             }
19         },
20         defaultValueCreator: (bindable) =>
21         {
22             var instance = (Button)bindable;
23             return instance.InternalText;
24         });
25
26         /// <summary>
27         /// TranslatableTextProperty
28         /// </summary>
29         [EditorBrowsable(EditorBrowsableState.Never)]
30         public static readonly BindableProperty TranslatableTextProperty = BindableProperty.Create(nameof(TranslatableText), typeof(string), typeof(Button), default(string), propertyChanged: (bindable, oldValue, newValue) =>
31         {
32             var instance = (Button)bindable;
33             if (newValue != null)
34             {
35                 instance.InternalTranslatableText = newValue as string;
36             }
37         },
38         defaultValueCreator: (bindable) =>
39         {
40             var instance = (Button)bindable;
41             return instance.InternalTranslatableText;
42         });
43
44         /// <summary>
45         /// PointSizeProperty
46         /// </summary>
47         [EditorBrowsable(EditorBrowsableState.Never)]
48         public static readonly BindableProperty PointSizeProperty = BindableProperty.Create(nameof(PointSize), typeof(float), typeof(Button), default(float), propertyChanged: (bindable, oldValue, newValue) =>
49         {
50             var instance = (Button)bindable;
51             if (newValue != null)
52             {
53                 instance.InternalPointSize = (float)newValue;
54             }
55         },
56         defaultValueCreator: (bindable) =>
57         {
58             var instance = (Button)bindable;
59             return instance.InternalPointSize;
60         });
61
62         /// <summary>
63         /// FontFamilyProperty
64         /// </summary>
65         [EditorBrowsable(EditorBrowsableState.Never)]
66         public static readonly BindableProperty FontFamilyProperty = BindableProperty.Create(nameof(FontFamily), typeof(string), typeof(Button), default(string), propertyChanged: (bindable, oldValue, newValue) =>
67         {
68             var instance = (Button)bindable;
69             if (newValue != null)
70             {
71                 instance.InternalFontFamily = newValue as string;
72             }
73         },
74         defaultValueCreator: (bindable) =>
75         {
76             var instance = (Button)bindable;
77             return instance.InternalFontFamily;
78         });
79
80         /// <summary>
81         /// TextColorProperty
82         /// </summary>
83         [EditorBrowsable(EditorBrowsableState.Never)]
84         public static readonly BindableProperty TextColorProperty = BindableProperty.Create(nameof(TextColor), typeof(Color), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
85         {
86             var instance = (Button)bindable;
87             if (newValue != null)
88             {
89                 instance.InternalTextColor = newValue as Color;
90             }
91         },
92         defaultValueCreator: (bindable) =>
93         {
94             var instance = (Button)bindable;
95             return instance.InternalTextColor;
96         });
97
98         /// <summary>
99         /// TextAlignmentProperty
100         /// </summary>
101         [EditorBrowsable(EditorBrowsableState.Never)]
102         public static readonly BindableProperty TextAlignmentProperty = BindableProperty.Create(nameof(TextAlignment), typeof(HorizontalAlignment), typeof(Button), default(HorizontalAlignment), propertyChanged: (bindable, oldValue, newValue) =>
103         {
104             var instance = (Button)bindable;
105             if (newValue != null)
106             {
107                 instance.InternalTextAlignment = (HorizontalAlignment)newValue;
108             }
109         },
110         defaultValueCreator: (bindable) =>
111         {
112             var instance = (Button)bindable;
113             return instance.InternalTextAlignment;
114         });
115
116         /// <summary>
117         /// IconURLProperty
118         /// </summary>
119         [EditorBrowsable(EditorBrowsableState.Never)]
120         public static readonly BindableProperty IconURLProperty = BindableProperty.Create(nameof(IconURL), typeof(string), typeof(Button), default(string), propertyChanged: (bindable, oldValue, newValue) =>
121         {
122             var instance = (Button)bindable;
123             if (newValue != null)
124             {
125                 instance.InternalIconURL = newValue as string;
126             }
127         },
128         defaultValueCreator: (bindable) =>
129         {
130             var instance = (Button)bindable;
131             return instance.InternalIconURL;
132         });
133
134         /// <summary>
135         /// IconSizeProperty
136         /// </summary>
137         [EditorBrowsable(EditorBrowsableState.Never)]
138         public static readonly BindableProperty IconSizeProperty = BindableProperty.Create(nameof(IconSize), typeof(Size), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
139         {
140             var instance = (Button)bindable;
141             if (newValue != null)
142             {
143                 instance.InternalIconSize = newValue as Size;
144             }
145         },
146         defaultValueCreator: (bindable) =>
147         {
148             var instance = (Button)bindable;
149             return instance.InternalIconSize;
150         });
151
152         /// <summary>
153         /// TextSelectorProperty
154         /// </summary>
155         [EditorBrowsable(EditorBrowsableState.Never)]
156         public static readonly BindableProperty TextSelectorProperty = BindableProperty.Create(nameof(TextSelector), typeof(StringSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
157         {
158             var instance = (Button)bindable;
159             if (newValue != null)
160             {
161                 instance.InternalTextSelector = newValue as StringSelector;
162             }
163         },
164         defaultValueCreator: (bindable) =>
165         {
166             var instance = (Button)bindable;
167             return instance.InternalTextSelector;
168         });
169
170         /// <summary>
171         /// TranslatableTextSelectorProperty
172         /// </summary>
173         [EditorBrowsable(EditorBrowsableState.Never)]
174         public static readonly BindableProperty TranslatableTextSelectorProperty = BindableProperty.Create(nameof(TranslatableTextSelector), typeof(StringSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
175         {
176             var instance = (Button)bindable;
177             if (newValue != null)
178             {
179                 instance.InternalTranslatableTextSelector = newValue as StringSelector;
180             }
181         },
182         defaultValueCreator: (bindable) =>
183         {
184             var instance = (Button)bindable;
185             return instance.InternalTranslatableTextSelector;
186         });
187
188         /// <summary>
189         /// TextColorSelectorProperty
190         /// </summary>
191         [EditorBrowsable(EditorBrowsableState.Never)]
192         public static readonly BindableProperty TextColorSelectorProperty = BindableProperty.Create(nameof(TextColorSelector), typeof(ColorSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
193         {
194             var instance = (Button)bindable;
195             if (newValue != null)
196             {
197                 instance.InternalTextColorSelector = newValue as ColorSelector;
198             }
199         },
200         defaultValueCreator: (bindable) =>
201         {
202             var instance = (Button)bindable;
203             return instance.InternalTextColorSelector;
204         });
205
206         /// <summary>
207         /// PointSizeSelectorProperty
208         /// </summary>
209         [EditorBrowsable(EditorBrowsableState.Never)]
210         public static readonly BindableProperty PointSizeSelectorProperty = BindableProperty.Create(nameof(PointSizeSelector), typeof(FloatSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
211         {
212             var instance = (Button)bindable;
213             if (newValue != null)
214             {
215                 instance.InternalPointSizeSelector = newValue as FloatSelector;
216             }
217         },
218         defaultValueCreator: (bindable) =>
219         {
220             var instance = (Button)bindable;
221             return instance.InternalPointSizeSelector;
222         });
223
224         /// <summary>
225         /// IconURLSelectorProperty
226         /// </summary>
227         [EditorBrowsable(EditorBrowsableState.Never)]
228         public static readonly BindableProperty IconURLSelectorProperty = BindableProperty.Create(nameof(IconURLSelector), typeof(StringSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
229         {
230             var instance = (Button)bindable;
231             if (newValue != null)
232             {
233                 instance.InternalIconURLSelector = newValue as StringSelector;
234             }
235         },
236         defaultValueCreator: (bindable) =>
237         {
238             var instance = (Button)bindable;
239             return instance.InternalIconURLSelector;
240         });
241     }
242 }