[NUI] Add bindable properties to Components.
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Controls / PaginationBindableProperty.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 Pagination
8     {
9         /// <summary>
10         /// LastIndicatorImageUrlProperty
11         /// </summary>
12         [EditorBrowsable(EditorBrowsableState.Never)]
13         public static readonly BindableProperty LastIndicatorImageUrlProperty = BindableProperty.Create(nameof(LastIndicatorImageUrl), typeof(Tizen.NUI.BaseComponents.Selector<string>), typeof(Pagination), null, propertyChanged: (bindable, oldValue, newValue) =>
14         {
15             var instance = (Pagination)bindable;
16             if (newValue != null)
17             {
18                 instance.InternalLastIndicatorImageUrl = newValue as Selector<string>;
19             }
20         },
21         defaultValueCreator: (bindable) =>
22         {
23             var instance = (Pagination)bindable;
24             return instance.InternalLastIndicatorImageUrl;
25         });
26
27         /// <summary>
28         /// IndicatorCountProperty
29         /// </summary>
30         [EditorBrowsable(EditorBrowsableState.Never)]
31         public static readonly BindableProperty IndicatorCountProperty = BindableProperty.Create(nameof(IndicatorCount), typeof(int), typeof(Pagination), default(int), propertyChanged: (bindable, oldValue, newValue) =>
32         {
33             var instance = (Pagination)bindable;
34             if (newValue != null)
35             {
36                 instance.InternalIndicatorCount = (int)newValue;
37             }
38         },
39         defaultValueCreator: (bindable) =>
40         {
41             var instance = (Pagination)bindable;
42             return instance.InternalIndicatorCount;
43         });
44
45         /// <summary>
46         /// IndicatorColorProperty
47         /// </summary>
48         [EditorBrowsable(EditorBrowsableState.Never)]
49         public static readonly BindableProperty IndicatorColorProperty = BindableProperty.Create(nameof(IndicatorColor), typeof(Color), typeof(Pagination), null, propertyChanged: (bindable, oldValue, newValue) =>
50         {
51             var instance = (Pagination)bindable;
52             if (newValue != null)
53             {
54                 instance.InternalIndicatorColor = newValue as Color;
55             }
56         },
57         defaultValueCreator: (bindable) =>
58         {
59             var instance = (Pagination)bindable;
60             return instance.InternalIndicatorColor;
61         });
62
63         /// <summary>
64         /// SelectedIndicatorColorProperty
65         /// </summary>
66         [EditorBrowsable(EditorBrowsableState.Never)]
67         public static readonly BindableProperty SelectedIndicatorColorProperty = BindableProperty.Create(nameof(SelectedIndicatorColor), typeof(Color), typeof(Pagination), null, propertyChanged: (bindable, oldValue, newValue) =>
68         {
69             var instance = (Pagination)bindable;
70             if (newValue != null)
71             {
72                 instance.InternalSelectedIndicatorColor = newValue as Color;
73             }
74         },
75         defaultValueCreator: (bindable) =>
76         {
77             var instance = (Pagination)bindable;
78             return instance.InternalSelectedIndicatorColor;
79         });
80
81         /// <summary>
82         /// SelectedIndexProperty
83         /// </summary>
84         [EditorBrowsable(EditorBrowsableState.Never)]
85         public static readonly BindableProperty SelectedIndexProperty = BindableProperty.Create(nameof(SelectedIndex), typeof(int), typeof(Pagination), default(int), propertyChanged: (bindable, oldValue, newValue) =>
86         {
87             var instance = (Pagination)bindable;
88             if (newValue != null)
89             {
90                 instance.InternalSelectedIndex = (int)newValue;
91             }
92         },
93         defaultValueCreator: (bindable) =>
94         {
95             var instance = (Pagination)bindable;
96             return instance.InternalSelectedIndex;
97         });
98     }
99 }