[NUI] Add bindable properties to Components.
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Controls / SliderBindableProperty.cs
1 using System.ComponentModel;
2 using Tizen.NUI.BaseComponents;
3 using Tizen.NUI.Binding;
4
5 namespace Tizen.NUI.Components
6 {
7     public partial class Slider
8     {
9         /// <summary>
10         /// DirectionProperty
11         /// </summary>
12         [EditorBrowsable(EditorBrowsableState.Never)]
13         public static readonly BindableProperty DirectionProperty = BindableProperty.Create(nameof(Direction), typeof(DirectionType), typeof(Slider), default(DirectionType), propertyChanged: (bindable, oldValue, newValue) =>
14         {
15             var instance = (Slider)bindable;
16             if (newValue != null)
17             {
18                 instance.InternalDirection = (DirectionType)newValue;
19             }
20         },
21         defaultValueCreator: (bindable) =>
22         {
23             var instance = (Slider)bindable;
24             return instance.InternalDirection;
25         });
26
27         /// <summary>
28         /// MinValueProperty
29         /// </summary>
30         [EditorBrowsable(EditorBrowsableState.Never)]
31         public static readonly BindableProperty MinValueProperty = BindableProperty.Create(nameof(MinValue), typeof(float), typeof(Slider), default(float), propertyChanged: (bindable, oldValue, newValue) =>
32         {
33             var instance = (Slider)bindable;
34             if (newValue != null)
35             {
36                 instance.InternalMinValue = (float)newValue;
37             }
38         },
39         defaultValueCreator: (bindable) =>
40         {
41             var instance = (Slider)bindable;
42             return instance.InternalMinValue;
43         });
44
45         /// <summary>
46         /// MaxValueProperty
47         /// </summary>
48         [EditorBrowsable(EditorBrowsableState.Never)]
49         public static readonly BindableProperty MaxValueProperty = BindableProperty.Create(nameof(MaxValue), typeof(float), typeof(Slider), default(float), propertyChanged: (bindable, oldValue, newValue) =>
50         {
51             var instance = (Slider)bindable;
52             if (newValue != null)
53             {
54                 instance.InternalMaxValue = (float)newValue;
55             }
56         },
57         defaultValueCreator: (bindable) =>
58         {
59             var instance = (Slider)bindable;
60             return instance.InternalMaxValue;
61         });
62
63         /// <summary>
64         /// ThumbSizeProperty
65         /// </summary>
66         [EditorBrowsable(EditorBrowsableState.Never)]
67         public static readonly BindableProperty ThumbSizeProperty = BindableProperty.Create(nameof(ThumbSize), typeof(Size), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) =>
68         {
69             var instance = (Slider)bindable;
70             if (newValue != null)
71             {
72                 instance.InternalThumbSize = newValue as Size;
73             }
74         },
75         defaultValueCreator: (bindable) =>
76         {
77             var instance = (Slider)bindable;
78             return instance.InternalThumbSize;
79         });
80
81         /// <summary>
82         /// ThumbImageURLProperty
83         /// </summary>
84         [EditorBrowsable(EditorBrowsableState.Never)]
85         public static readonly BindableProperty ThumbImageURLProperty = BindableProperty.Create(nameof(ThumbImageURL), typeof(string), typeof(Slider), default(string), propertyChanged: (bindable, oldValue, newValue) =>
86         {
87             var instance = (Slider)bindable;
88             if (newValue != null)
89             {
90                 instance.InternalThumbImageURL = newValue as string;
91             }
92         },
93         defaultValueCreator: (bindable) =>
94         {
95             var instance = (Slider)bindable;
96             return instance.InternalThumbImageURL;
97         });
98
99         /// <summary>
100         /// ThumbImageURLSelectorProperty
101         /// </summary>
102         [EditorBrowsable(EditorBrowsableState.Never)]
103         public static readonly BindableProperty ThumbImageURLSelectorProperty = BindableProperty.Create(nameof(ThumbImageURLSelector), typeof(StringSelector), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) =>
104         {
105             var instance = (Slider)bindable;
106             if (newValue != null)
107             {
108                 instance.InternalThumbImageURLSelector = newValue as StringSelector;
109             }
110         },
111         defaultValueCreator: (bindable) =>
112         {
113             var instance = (Slider)bindable;
114             return instance.InternalThumbImageURLSelector;
115         });
116
117         /// <summary>
118         /// ThumbImageUrlProperty
119         /// </summary>
120         [EditorBrowsable(EditorBrowsableState.Never)]
121         public static readonly BindableProperty ThumbImageUrlProperty = BindableProperty.Create(nameof(ThumbImageUrl), typeof(Selector<string>), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) =>
122         {
123             var instance = (Slider)bindable;
124             if (newValue != null)
125             {
126                 instance.InternalThumbImageUrl = newValue as Tizen.NUI.BaseComponents.Selector<string>;
127             }
128         },
129         defaultValueCreator: (bindable) =>
130         {
131             var instance = (Slider)bindable;
132             return instance.InternalThumbImageUrl;
133         });
134
135         /// <summary>
136         /// ThumbColorProperty
137         /// </summary>
138         [EditorBrowsable(EditorBrowsableState.Never)]
139         public static readonly BindableProperty ThumbColorProperty = BindableProperty.Create(nameof(ThumbColor), typeof(Color), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) =>
140         {
141             var instance = (Slider)bindable;
142             if (newValue != null)
143             {
144                 instance.InternalThumbColor = newValue as Color;
145             }
146         },
147         defaultValueCreator: (bindable) =>
148         {
149             var instance = (Slider)bindable;
150             return instance.InternalThumbColor;
151         });
152
153         /// <summary>
154         /// BgTrackColorProperty
155         /// </summary>
156         [EditorBrowsable(EditorBrowsableState.Never)]
157         public static readonly BindableProperty BgTrackColorProperty = BindableProperty.Create(nameof(BgTrackColor), typeof(Color), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) =>
158         {
159             var instance = (Slider)bindable;
160             if (newValue != null)
161             {
162                 instance.InternalBgTrackColor = newValue as Color;
163             }
164         },
165         defaultValueCreator: (bindable) =>
166         {
167             var instance = (Slider)bindable;
168             return instance.InternalBgTrackColor;
169         });
170
171         /// <summary>
172         /// SlidedTrackColorProperty
173         /// </summary>
174         [EditorBrowsable(EditorBrowsableState.Never)]
175         public static readonly BindableProperty SlidedTrackColorProperty = BindableProperty.Create(nameof(SlidedTrackColor), typeof(Color), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) =>
176         {
177             var instance = (Slider)bindable;
178             if (newValue != null)
179             {
180                 instance.InternalSlidedTrackColor = newValue as Color;
181             }
182         },
183         defaultValueCreator: (bindable) =>
184         {
185             var instance = (Slider)bindable;
186             return instance.InternalSlidedTrackColor;
187         });
188
189         /// <summary>
190         /// WarningStartValueProperty
191         /// </summary>
192         [EditorBrowsable(EditorBrowsableState.Never)]
193         public static readonly BindableProperty WarningStartValueProperty = BindableProperty.Create(nameof(WarningStartValue), typeof(float), typeof(Slider), default(float), propertyChanged: (bindable, oldValue, newValue) =>
194         {
195             var instance = (Slider)bindable;
196             if (newValue != null)
197             {
198                 instance.InternalWarningStartValue = (float)newValue;
199             }
200         },
201         defaultValueCreator: (bindable) =>
202         {
203             var instance = (Slider)bindable;
204             return instance.InternalWarningStartValue;
205         });
206
207         /// <summary>
208         /// WarningTrackColorProperty
209         /// </summary>
210         [EditorBrowsable(EditorBrowsableState.Never)]
211         public static readonly BindableProperty WarningTrackColorProperty = BindableProperty.Create(nameof(WarningTrackColor), typeof(Color), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) =>
212         {
213             var instance = (Slider)bindable;
214             if (newValue != null)
215             {
216                 instance.InternalWarningTrackColor = newValue as Color;
217             }
218         },
219         defaultValueCreator: (bindable) =>
220         {
221             var instance = (Slider)bindable;
222             return instance.InternalWarningTrackColor;
223         });
224
225         /// <summary>
226         /// WarningSlidedTrackColorProperty
227         /// </summary>
228         [EditorBrowsable(EditorBrowsableState.Never)]
229         public static readonly BindableProperty WarningSlidedTrackColorProperty = BindableProperty.Create(nameof(WarningSlidedTrackColor), typeof(Color), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) =>
230         {
231             var instance = (Slider)bindable;
232             if (newValue != null)
233             {
234                 instance.InternalWarningSlidedTrackColor = newValue as Color;
235             }
236         },
237         defaultValueCreator: (bindable) =>
238         {
239             var instance = (Slider)bindable;
240             return instance.InternalWarningSlidedTrackColor;
241         });
242
243         /// <summary>
244         /// WarningThumbImageUrlProperty
245         /// </summary>
246         [EditorBrowsable(EditorBrowsableState.Never)]
247         public static readonly BindableProperty WarningThumbImageUrlProperty = BindableProperty.Create(nameof(WarningThumbImageUrl), typeof(Tizen.NUI.BaseComponents.Selector<string>), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) =>
248         {
249             var instance = (Slider)bindable;
250             if (newValue != null)
251             {
252                 instance.InternalWarningThumbImageUrl = newValue as Tizen.NUI.BaseComponents.Selector<string>;
253             }
254         },
255         defaultValueCreator: (bindable) =>
256         {
257             var instance = (Slider)bindable;
258             return instance.InternalWarningThumbImageUrl;
259         });
260
261         /// <summary>
262         /// WarningThumbColorProperty
263         /// </summary>
264         [EditorBrowsable(EditorBrowsableState.Never)]
265         public static readonly BindableProperty WarningThumbColorProperty = BindableProperty.Create(nameof(WarningThumbColor), typeof(Color), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) =>
266         {
267             var instance = (Slider)bindable;
268             if (newValue != null)
269             {
270                 instance.InternalWarningThumbColor = newValue as Color;
271             }
272         },
273         defaultValueCreator: (bindable) =>
274         {
275             var instance = (Slider)bindable;
276             return instance.InternalWarningThumbColor;
277         });
278
279         /// <summary>
280         /// LowIndicatorImageURLProperty
281         /// </summary>
282         [EditorBrowsable(EditorBrowsableState.Never)]
283         public static readonly BindableProperty LowIndicatorImageURLProperty = BindableProperty.Create(nameof(LowIndicatorImageURL), typeof(string), typeof(Slider), default(string), propertyChanged: (bindable, oldValue, newValue) =>
284         {
285             var instance = (Slider)bindable;
286             if (newValue != null)
287             {
288                 instance.InternalLowIndicatorImageURL = newValue as string;
289             }
290         },
291         defaultValueCreator: (bindable) =>
292         {
293             var instance = (Slider)bindable;
294             return instance.InternalLowIndicatorImageURL;
295         });
296
297         /// <summary>
298         /// HighIndicatorImageURLProperty
299         /// </summary>
300         [EditorBrowsable(EditorBrowsableState.Never)]
301         public static readonly BindableProperty HighIndicatorImageURLProperty = BindableProperty.Create(nameof(HighIndicatorImageURL), typeof(string), typeof(Slider), default(string), propertyChanged: (bindable, oldValue, newValue) =>
302         {
303             var instance = (Slider)bindable;
304             if (newValue != null)
305             {
306                 instance.InternalHighIndicatorImageURL = newValue as string;
307             }
308         },
309         defaultValueCreator: (bindable) =>
310         {
311             var instance = (Slider)bindable;
312             return instance.InternalHighIndicatorImageURL;
313         });
314
315         /// <summary>
316         /// LowIndicatorTextContentProperty
317         /// </summary>
318         [EditorBrowsable(EditorBrowsableState.Never)]
319         public static readonly BindableProperty LowIndicatorTextContentProperty = BindableProperty.Create(nameof(LowIndicatorTextContent), typeof(string), typeof(Slider), default(string), propertyChanged: (bindable, oldValue, newValue) =>
320         {
321             var instance = (Slider)bindable;
322             if (newValue != null)
323             {
324                 instance.InternalLowIndicatorTextContent = newValue as string;
325             }
326         },
327         defaultValueCreator: (bindable) =>
328         {
329             var instance = (Slider)bindable;
330             return instance.InternalLowIndicatorTextContent;
331         });
332
333         /// <summary>
334         /// HighIndicatorTextContentProperty
335         /// </summary>
336         [EditorBrowsable(EditorBrowsableState.Never)]
337         public static readonly BindableProperty HighIndicatorTextContentProperty = BindableProperty.Create(nameof(HighIndicatorTextContent), typeof(string), typeof(Slider), default(string), propertyChanged: (bindable, oldValue, newValue) =>
338         {
339             var instance = (Slider)bindable;
340             if (newValue != null)
341             {
342                 instance.InternalHighIndicatorTextContent = newValue as string;
343             }
344         },
345         defaultValueCreator: (bindable) =>
346         {
347             var instance = (Slider)bindable;
348             return instance.InternalHighIndicatorTextContent;
349         });
350
351         /// <summary>
352         /// LowIndicatorSizeProperty
353         /// </summary>
354         [EditorBrowsable(EditorBrowsableState.Never)]
355         public static readonly BindableProperty LowIndicatorSizeProperty = BindableProperty.Create(nameof(LowIndicatorSize), typeof(Size), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) =>
356         {
357             var instance = (Slider)bindable;
358             if (newValue != null)
359             {
360                 instance.InternalLowIndicatorSize = newValue as Size;
361             }
362         },
363         defaultValueCreator: (bindable) =>
364         {
365             var instance = (Slider)bindable;
366             return instance.InternalLowIndicatorSize;
367         });
368
369         /// <summary>
370         /// HighIndicatorSizeProperty
371         /// </summary>
372         [EditorBrowsable(EditorBrowsableState.Never)]
373         public static readonly BindableProperty HighIndicatorSizeProperty = BindableProperty.Create(nameof(HighIndicatorSize), typeof(Size), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) =>
374         {
375             var instance = (Slider)bindable;
376             if (newValue != null)
377             {
378                 instance.InternalHighIndicatorSize = newValue as Size;
379             }
380         },
381         defaultValueCreator: (bindable) =>
382         {
383             var instance = (Slider)bindable;
384             return instance.InternalHighIndicatorSize;
385         });
386
387         /// <summary>
388         /// ValueIndicatorSizeProperty
389         /// </summary>
390         [EditorBrowsable(EditorBrowsableState.Never)]
391         public static readonly BindableProperty ValueIndicatorSizeProperty = BindableProperty.Create(nameof(ValueIndicatorSize), typeof(Size), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) =>
392         {
393             var instance = (Slider)bindable;
394             if (newValue != null)
395             {
396                 instance.InternalValueIndicatorSize = newValue as Size;
397             }
398         },
399         defaultValueCreator: (bindable) =>
400         {
401             var instance = (Slider)bindable;
402             return instance.InternalValueIndicatorSize;
403         });
404
405         /// <summary>
406         /// ValueIndicatorUrlProperty
407         /// </summary>
408         [EditorBrowsable(EditorBrowsableState.Never)]
409         public static readonly BindableProperty ValueIndicatorUrlProperty = BindableProperty.Create(nameof(ValueIndicatorUrl), typeof(string), typeof(Slider), default(string), propertyChanged: (bindable, oldValue, newValue) =>
410         {
411             var instance = (Slider)bindable;
412             if (newValue != null)
413             {
414                 instance.InternalValueIndicatorUrl = newValue as string;
415             }
416         },
417         defaultValueCreator: (bindable) =>
418         {
419             var instance = (Slider)bindable;
420             return instance.InternalValueIndicatorUrl;
421         });
422
423         /// <summary>
424         /// IsDiscreteProperty
425         /// </summary>
426         [EditorBrowsable(EditorBrowsableState.Never)]
427         public static readonly BindableProperty IsDiscreteProperty = BindableProperty.Create(nameof(IsDiscrete), typeof(bool), typeof(Slider), default(bool), propertyChanged: (bindable, oldValue, newValue) =>
428         {
429             var instance = (Slider)bindable;
430             if (newValue != null)
431             {
432                 instance.InternalIsDiscrete = (bool)newValue;
433             }
434         },
435         defaultValueCreator: (bindable) =>
436         {
437             var instance = (Slider)bindable;
438             return instance.InternalIsDiscrete;
439         });
440
441         /// <summary>
442         /// DiscreteValueProperty
443         /// </summary>
444         [EditorBrowsable(EditorBrowsableState.Never)]
445         public static readonly BindableProperty DiscreteValueProperty = BindableProperty.Create(nameof(DiscreteValue), typeof(float), typeof(Slider), default(float), propertyChanged: (bindable, oldValue, newValue) =>
446         {
447             var instance = (Slider)bindable;
448             if (newValue != null)
449             {
450                 instance.InternalDiscreteValue = (float)newValue;
451             }
452         },
453         defaultValueCreator: (bindable) =>
454         {
455             var instance = (Slider)bindable;
456             return instance.InternalDiscreteValue;
457         });
458
459     }
460 }