[NUI] Fix failed in TCT
[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             instance.InternalTextSelector = newValue as StringSelector;
160         },
161         defaultValueCreator: (bindable) =>
162         {
163             var instance = (Button)bindable;
164             return instance.InternalTextSelector;
165         });
166
167         /// <summary>
168         /// TranslatableTextSelectorProperty
169         /// </summary>
170         [EditorBrowsable(EditorBrowsableState.Never)]
171         public static readonly BindableProperty TranslatableTextSelectorProperty = BindableProperty.Create(nameof(TranslatableTextSelector), typeof(StringSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
172         {
173             var instance = (Button)bindable;
174             instance.InternalTranslatableTextSelector = newValue as StringSelector;
175         },
176         defaultValueCreator: (bindable) =>
177         {
178             var instance = (Button)bindable;
179             return instance.InternalTranslatableTextSelector;
180         });
181
182         /// <summary>
183         /// TextColorSelectorProperty
184         /// </summary>
185         [EditorBrowsable(EditorBrowsableState.Never)]
186         public static readonly BindableProperty TextColorSelectorProperty = BindableProperty.Create(nameof(TextColorSelector), typeof(ColorSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
187         {
188             var instance = (Button)bindable;
189             instance.InternalTextColorSelector = newValue as ColorSelector;
190         },
191         defaultValueCreator: (bindable) =>
192         {
193             var instance = (Button)bindable;
194             return instance.InternalTextColorSelector;
195         });
196
197         /// <summary>
198         /// PointSizeSelectorProperty
199         /// </summary>
200         [EditorBrowsable(EditorBrowsableState.Never)]
201         public static readonly BindableProperty PointSizeSelectorProperty = BindableProperty.Create(nameof(PointSizeSelector), typeof(FloatSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
202         {
203             var instance = (Button)bindable;
204             instance.InternalPointSizeSelector = newValue as FloatSelector;
205         },
206         defaultValueCreator: (bindable) =>
207         {
208             var instance = (Button)bindable;
209             return instance.InternalPointSizeSelector;
210         });
211
212         /// <summary>
213         /// IconURLSelectorProperty
214         /// </summary>
215         [EditorBrowsable(EditorBrowsableState.Never)]
216         public static readonly BindableProperty IconURLSelectorProperty = BindableProperty.Create(nameof(IconURLSelector), typeof(StringSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
217         {
218             var instance = (Button)bindable;
219             instance.InternalIconURLSelector = newValue as StringSelector;
220         },
221         defaultValueCreator: (bindable) =>
222         {
223             var instance = (Button)bindable;
224             return instance.InternalIconURLSelector;
225         });
226     }
227 }