4198a350535b9bc2711a5f5998b6f12f98bff3cc
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Controls / ScrollableBaseBindableProperty.cs
1 using System.ComponentModel;
2 using Tizen.NUI.Binding;
3
4 namespace Tizen.NUI.Components
5 {
6     public partial class ScrollableBase
7     {
8         /// <summary>
9         /// ScrollingDirectionProperty
10         /// </summary>
11         [EditorBrowsable(EditorBrowsableState.Never)]
12         public static readonly BindableProperty ScrollingDirectionProperty = BindableProperty.Create(nameof(ScrollingDirection), typeof(Direction), typeof(ScrollableBase), default(Direction), propertyChanged: (bindable, oldValue, newValue) =>
13         {
14             var instance = (ScrollableBase)bindable;
15             if (newValue != null)
16             {
17                 instance.InternalScrollingDirection = (Direction)newValue;
18             }
19         },
20         defaultValueCreator: (bindable) =>
21         {
22             var instance = (ScrollableBase)bindable;
23             return instance.InternalScrollingDirection;
24         });
25
26         /// <summary>
27         /// ScrollEnabledProperty
28         /// </summary>
29         [EditorBrowsable(EditorBrowsableState.Never)]
30         public static readonly BindableProperty ScrollEnabledProperty = BindableProperty.Create(nameof(ScrollEnabled), typeof(bool), typeof(ScrollableBase), default(bool), propertyChanged: (bindable, oldValue, newValue) =>
31         {
32             var instance = (ScrollableBase)bindable;
33             if (newValue != null)
34             {
35                 instance.InternalScrollEnabled = (bool)newValue;
36             }
37         },
38         defaultValueCreator: (bindable) =>
39         {
40             var instance = (ScrollableBase)bindable;
41             return instance.InternalScrollEnabled;
42         });
43
44         /// <summary>
45         /// SnapToPageProperty
46         /// </summary>
47         [EditorBrowsable(EditorBrowsableState.Never)]
48         public static readonly BindableProperty SnapToPageProperty = BindableProperty.Create(nameof(SnapToPage), typeof(bool), typeof(ScrollableBase), default(bool), propertyChanged: (bindable, oldValue, newValue) =>
49         {
50             var instance = (ScrollableBase)bindable;
51             if (newValue != null)
52             {
53                 instance.InternalSnapToPage = (bool)newValue;
54             }
55         },
56         defaultValueCreator: (bindable) =>
57         {
58             var instance = (ScrollableBase)bindable;
59             return instance.InternalSnapToPage;
60         });
61
62         /// <summary>
63         /// ScrollDurationProperty
64         /// </summary>
65         [EditorBrowsable(EditorBrowsableState.Never)]
66         public static readonly BindableProperty ScrollDurationProperty = BindableProperty.Create(nameof(ScrollDuration), typeof(int), typeof(ScrollableBase), default(int), propertyChanged: (bindable, oldValue, newValue) =>
67         {
68             var instance = (ScrollableBase)bindable;
69             if (newValue != null)
70             {
71                 instance.InternalScrollDuration = (int)newValue;
72             }
73         },
74         defaultValueCreator: (bindable) =>
75         {
76             var instance = (ScrollableBase)bindable;
77             return instance.InternalScrollDuration;
78         });
79
80         /// <summary>
81         /// ScrollAvailableAreaProperty
82         /// </summary>
83         [EditorBrowsable(EditorBrowsableState.Never)]
84         public static readonly BindableProperty ScrollAvailableAreaProperty = BindableProperty.Create(nameof(ScrollAvailableArea), typeof(Vector2), typeof(ScrollableBase), null, propertyChanged: (bindable, oldValue, newValue) =>
85         {
86             var instance = (ScrollableBase)bindable;
87             if (newValue != null)
88             {
89                 instance.InternalScrollAvailableArea = newValue as Vector2;
90             }
91         },
92         defaultValueCreator: (bindable) =>
93         {
94             var instance = (ScrollableBase)bindable;
95             return instance.InternalScrollAvailableArea;
96         });
97
98         /// <summary>
99         /// ScrollbarProperty
100         /// </summary>
101         [EditorBrowsable(EditorBrowsableState.Never)]
102         public static readonly BindableProperty ScrollbarProperty = BindableProperty.Create(nameof(Scrollbar), typeof(ScrollbarBase), typeof(ScrollableBase), null, propertyChanged: (bindable, oldValue, newValue) =>
103         {
104             var instance = (ScrollableBase)bindable;
105             if (newValue != null)
106             {
107                 instance.InternalScrollbar = newValue as ScrollbarBase;
108             }
109         },
110         defaultValueCreator: (bindable) =>
111         {
112             var instance = (ScrollableBase)bindable;
113             return instance.InternalScrollbar;
114         });
115
116         /// <summary>
117         /// HideScrollbarProperty
118         /// </summary>
119         [EditorBrowsable(EditorBrowsableState.Never)]
120         public static readonly BindableProperty HideScrollbarProperty = BindableProperty.Create(nameof(HideScrollbar), typeof(bool), typeof(ScrollableBase), default(bool), propertyChanged: (bindable, oldValue, newValue) =>
121         {
122             var instance = (ScrollableBase)bindable;
123             if (newValue != null)
124             {
125                 instance.InternalHideScrollbar = (bool)newValue;
126             }
127         },
128         defaultValueCreator: (bindable) =>
129         {
130             var instance = (ScrollableBase)bindable;
131             return instance.InternalHideScrollbar;
132         });
133
134         /// <summary>
135         /// LayoutProperty
136         /// </summary>
137         [EditorBrowsable(EditorBrowsableState.Never)]
138         public static readonly new BindableProperty LayoutProperty = BindableProperty.Create(nameof(Layout), typeof(LayoutItem), typeof(ScrollableBase), null, propertyChanged: (bindable, oldValue, newValue) =>
139         {
140             var instance = (ScrollableBase)bindable;
141             if (newValue != null)
142             {
143                 instance.InternalLayout = newValue as LayoutItem;
144             }
145         },
146         defaultValueCreator: (bindable) =>
147         {
148             var instance = (ScrollableBase)bindable;
149             return instance.InternalLayout;
150         });
151
152         /// <summary>
153         /// DecelerationRateProperty
154         /// </summary>
155         [EditorBrowsable(EditorBrowsableState.Never)]
156         public static readonly BindableProperty DecelerationRateProperty = BindableProperty.Create(nameof(DecelerationRate), typeof(float), typeof(ScrollableBase), default(float), propertyChanged: (bindable, oldValue, newValue) =>
157         {
158             var instance = (ScrollableBase)bindable;
159             if (newValue != null)
160             {
161                 instance.InternalDecelerationRate = (float)newValue;
162             }
163         },
164         defaultValueCreator: (bindable) =>
165         {
166             var instance = (ScrollableBase)bindable;
167             return instance.InternalDecelerationRate;
168         });
169
170         /// <summary>
171         /// DecelerationThresholdProperty
172         /// </summary>
173         [EditorBrowsable(EditorBrowsableState.Never)]
174         public static readonly BindableProperty DecelerationThresholdProperty = BindableProperty.Create(nameof(DecelerationThreshold), typeof(float), typeof(ScrollableBase), default(float), propertyChanged: (bindable, oldValue, newValue) =>
175         {
176             var instance = (ScrollableBase)bindable;
177             if (newValue != null)
178             {
179                 instance.InternalDecelerationThreshold = (float)newValue;
180             }
181         },
182         defaultValueCreator: (bindable) =>
183         {
184             var instance = (ScrollableBase)bindable;
185             return instance.InternalDecelerationThreshold;
186         });
187
188         /// <summary>
189         /// ScrollingEventThresholdProperty
190         /// </summary>
191         [EditorBrowsable(EditorBrowsableState.Never)]
192         public static readonly BindableProperty ScrollingEventThresholdProperty = BindableProperty.Create(nameof(ScrollingEventThreshold), typeof(float), typeof(ScrollableBase), default(float), propertyChanged: (bindable, oldValue, newValue) =>
193         {
194             var instance = (ScrollableBase)bindable;
195             if (newValue != null)
196             {
197                 instance.InternalScrollingEventThreshold = (float)newValue;
198             }
199         },
200         defaultValueCreator: (bindable) =>
201         {
202             var instance = (ScrollableBase)bindable;
203             return instance.InternalScrollingEventThreshold;
204         });
205
206         /// <summary>
207         /// PageFlickThresholdProperty
208         /// </summary>
209         [EditorBrowsable(EditorBrowsableState.Never)]
210         public static readonly BindableProperty PageFlickThresholdProperty = BindableProperty.Create(nameof(PageFlickThreshold), typeof(float), typeof(ScrollableBase), default(float), propertyChanged: (bindable, oldValue, newValue) =>
211         {
212             var instance = (ScrollableBase)bindable;
213             if (newValue != null)
214             {
215                 instance.InternalPageFlickThreshold = (float)newValue;
216             }
217         },
218         defaultValueCreator: (bindable) =>
219         {
220             var instance = (ScrollableBase)bindable;
221             return instance.InternalPageFlickThreshold;
222         });
223
224         /// <summary>
225         /// PaddingProperty
226         /// </summary>
227         [EditorBrowsable(EditorBrowsableState.Never)]
228         public static readonly new BindableProperty PaddingProperty = BindableProperty.Create(nameof(Padding), typeof(Extents), typeof(ScrollableBase), null, propertyChanged: (bindable, oldValue, newValue) =>
229         {
230             var instance = (ScrollableBase)bindable;
231             if (newValue != null)
232             {
233                 instance.InternalPadding = newValue as Extents;
234             }
235         },
236         defaultValueCreator: (bindable) =>
237         {
238             var instance = (ScrollableBase)bindable;
239             return instance.InternalPadding;
240         });
241
242         /// <summary>
243         /// ScrollAlphaFunctionProperty
244         /// </summary>
245         [EditorBrowsable(EditorBrowsableState.Never)]
246         public static readonly BindableProperty ScrollAlphaFunctionProperty = BindableProperty.Create(nameof(ScrollAlphaFunction), typeof(AlphaFunction), typeof(ScrollableBase), null, propertyChanged: (bindable, oldValue, newValue) =>
247         {
248             var instance = (ScrollableBase)bindable;
249             if (newValue != null)
250             {
251                 instance.InternalScrollAlphaFunction = newValue as AlphaFunction;
252             }
253         },
254         defaultValueCreator: (bindable) =>
255         {
256             var instance = (ScrollableBase)bindable;
257             return instance.InternalScrollAlphaFunction;
258         });
259
260         /// <summary>
261         /// NoticeAnimationEndBeforePositionProperty
262         /// </summary>
263         [EditorBrowsable(EditorBrowsableState.Never)]
264         public static readonly BindableProperty NoticeAnimationEndBeforePositionProperty = BindableProperty.Create(nameof(NoticeAnimationEndBeforePosition), typeof(float), typeof(ScrollableBase), default(float), propertyChanged: (bindable, oldValue, newValue) =>
265         {
266             var instance = (ScrollableBase)bindable;
267             if (newValue != null)
268             {
269                 instance.InternalNoticeAnimationEndBeforePosition = (float)newValue;
270             }
271         },
272         defaultValueCreator: (bindable) =>
273         {
274             var instance = (ScrollableBase)bindable;
275             return instance.InternalNoticeAnimationEndBeforePosition;
276         });
277
278         /// <summary>
279         /// EnableOverShootingEffectProperty
280         /// </summary>
281         [EditorBrowsable(EditorBrowsableState.Never)]
282         public static readonly BindableProperty EnableOverShootingEffectProperty = BindableProperty.Create(nameof(EnableOverShootingEffect), typeof(bool), typeof(ScrollableBase), default(bool), propertyChanged: (bindable, oldValue, newValue) =>
283         {
284             var instance = (ScrollableBase)bindable;
285             if (newValue != null)
286             {
287                 instance.InternalEnableOverShootingEffect = (bool)newValue;
288             }
289         },
290         defaultValueCreator: (bindable) =>
291         {
292             var instance = (ScrollableBase)bindable;
293             return instance.InternalEnableOverShootingEffect;
294         });
295
296         /// <summary>
297         /// StepScrollDistanceProperty
298         /// </summary>
299         [EditorBrowsable(EditorBrowsableState.Never)]
300         public static readonly BindableProperty StepScrollDistanceProperty = BindableProperty.Create(nameof(StepScrollDistance), typeof(float), typeof(ScrollableBase), default(float), propertyChanged: (bindable, oldValue, newValue) =>
301         {
302             var instance = (ScrollableBase)bindable;
303             if (newValue != null)
304             {
305                 instance.stepScrollDistance = (float)newValue;
306             }
307         },
308         defaultValueCreator: (bindable) =>
309         {
310             var instance = (ScrollableBase)bindable;
311             return instance.stepScrollDistance;
312         });
313     }
314 }