4d97679b2ec97bbee4390016854acef4eabab3c6
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Utility / ItemViewBindableProperty.cs
1 /*
2  * Copyright(c) 2021 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 using System.ComponentModel;
19 using Tizen.NUI.Binding;
20
21 namespace Tizen.NUI
22 {
23     public partial class ItemView
24     {
25         /// <summary>
26         /// LayoutProperty
27         /// </summary>
28         [EditorBrowsable(EditorBrowsableState.Never)]
29         public static new readonly BindableProperty LayoutProperty = BindableProperty.Create(nameof(Layout), typeof(Tizen.NUI.PropertyArray), typeof(ItemView), null, propertyChanged: (bindable, oldValue, newValue) =>
30         {
31             var instance = (Tizen.NUI.ItemView)bindable;
32             if (newValue != null)
33             {
34                 instance.InternalLayout = (Tizen.NUI.PropertyArray)newValue;
35             }
36         },
37         defaultValueCreator: (bindable) =>
38         {
39             var instance = (Tizen.NUI.ItemView)bindable;
40             return instance.InternalLayout;
41         });
42
43         /// <summary>
44         /// MinimumSwipeSpeedProperty
45         /// </summary>
46         [EditorBrowsable(EditorBrowsableState.Never)]
47         public static readonly BindableProperty MinimumSwipeSpeedProperty = BindableProperty.Create(nameof(MinimumSwipeSpeed), typeof(float), typeof(ItemView), default(float), propertyChanged: (bindable, oldValue, newValue) =>
48         {
49             var instance = (Tizen.NUI.ItemView)bindable;
50             if (newValue != null)
51             {
52                 instance.InternalMinimumSwipeSpeed = (float)newValue;
53             }
54         },
55         defaultValueCreator: (bindable) =>
56         {
57             var instance = (Tizen.NUI.ItemView)bindable;
58             return instance.InternalMinimumSwipeSpeed;
59         });
60
61         /// <summary>
62         /// MinimumSwipeDistanceProperty
63         /// </summary>
64         [EditorBrowsable(EditorBrowsableState.Never)]
65         public static readonly BindableProperty MinimumSwipeDistanceProperty = BindableProperty.Create(nameof(MinimumSwipeDistance), typeof(float), typeof(ItemView), default(float), propertyChanged: (bindable, oldValue, newValue) =>
66         {
67             var instance = (Tizen.NUI.ItemView)bindable;
68             if (newValue != null)
69             {
70                 instance.InternalMinimumSwipeDistance = (float)newValue;
71             }
72         },
73         defaultValueCreator: (bindable) =>
74         {
75             var instance = (Tizen.NUI.ItemView)bindable;
76             return instance.InternalMinimumSwipeDistance;
77         });
78
79         /// <summary>
80         /// WheelScrollDistanceStepProperty
81         /// </summary>
82         [EditorBrowsable(EditorBrowsableState.Never)]
83         public static readonly BindableProperty WheelScrollDistanceStepProperty = BindableProperty.Create(nameof(WheelScrollDistanceStep), typeof(float), typeof(ItemView), default(float), propertyChanged: (bindable, oldValue, newValue) =>
84         {
85             var instance = (Tizen.NUI.ItemView)bindable;
86             if (newValue != null)
87             {
88                 instance.InternalWheelScrollDistanceStep = (float)newValue;
89             }
90         },
91         defaultValueCreator: (bindable) =>
92         {
93             var instance = (Tizen.NUI.ItemView)bindable;
94             return instance.InternalWheelScrollDistanceStep;
95         });
96
97         /// <summary>
98         /// SnapToItemEnabledProperty
99         /// </summary>
100         [EditorBrowsable(EditorBrowsableState.Never)]
101         public static readonly BindableProperty SnapToItemEnabledProperty = BindableProperty.Create(nameof(SnapToItemEnabled), typeof(bool), typeof(ItemView), true, propertyChanged: (bindable, oldValue, newValue) =>
102         {
103             var instance = (Tizen.NUI.ItemView)bindable;
104             if (newValue != null)
105             {
106                 instance.InternalSnapToItemEnabled = (bool)newValue;
107             }
108         },
109         defaultValueCreator: (bindable) =>
110         {
111             var instance = (Tizen.NUI.ItemView)bindable;
112             return instance.InternalSnapToItemEnabled;
113         });
114
115         /// <summary>
116         /// RefreshIntervalProperty
117         /// </summary>
118         [EditorBrowsable(EditorBrowsableState.Never)]
119         public static readonly BindableProperty RefreshIntervalProperty = BindableProperty.Create(nameof(RefreshInterval), typeof(float), typeof(ItemView), default(float), propertyChanged: (bindable, oldValue, newValue) =>
120         {
121             var instance = (Tizen.NUI.ItemView)bindable;
122             if (newValue != null)
123             {
124                 instance.InternalRefreshInterval = (float)newValue;
125             }
126         },
127         defaultValueCreator: (bindable) =>
128         {
129             var instance = (Tizen.NUI.ItemView)bindable;
130             return instance.InternalRefreshInterval;
131         });
132
133         /// <summary>
134         /// LayoutPositionProperty
135         /// </summary>
136         [EditorBrowsable(EditorBrowsableState.Never)]
137         public static readonly BindableProperty LayoutPositionProperty = BindableProperty.Create(nameof(LayoutPosition), typeof(float), typeof(ItemView), default(float), propertyChanged: (bindable, oldValue, newValue) =>
138         {
139             var instance = (Tizen.NUI.ItemView)bindable;
140             if (newValue != null)
141             {
142                 instance.InternalLayoutPosition = (float)newValue;
143             }
144         },
145         defaultValueCreator: (bindable) =>
146         {
147             var instance = (Tizen.NUI.ItemView)bindable;
148             return instance.InternalLayoutPosition;
149         });
150
151         /// <summary>
152         /// ScrollSpeedProperty
153         /// </summary>
154         [EditorBrowsable(EditorBrowsableState.Never)]
155         public static readonly BindableProperty ScrollSpeedProperty = BindableProperty.Create(nameof(ScrollSpeed), typeof(float), typeof(ItemView), default(float), propertyChanged: (bindable, oldValue, newValue) =>
156         {
157             var instance = (Tizen.NUI.ItemView)bindable;
158             if (newValue != null)
159             {
160                 instance.InternalScrollSpeed = (float)newValue;
161             }
162         },
163         defaultValueCreator: (bindable) =>
164         {
165             var instance = (Tizen.NUI.ItemView)bindable;
166             return instance.InternalScrollSpeed;
167         });
168
169         /// <summary>
170         /// OvershootProperty
171         /// </summary>
172         [EditorBrowsable(EditorBrowsableState.Never)]
173         public static readonly BindableProperty OvershootProperty = BindableProperty.Create(nameof(Overshoot), typeof(float), typeof(ItemView), default(float), propertyChanged: (bindable, oldValue, newValue) =>
174         {
175             var instance = (Tizen.NUI.ItemView)bindable;
176             if (newValue != null)
177             {
178                 instance.InternalOvershoot = (float)newValue;
179             }
180         },
181         defaultValueCreator: (bindable) =>
182         {
183             var instance = (Tizen.NUI.ItemView)bindable;
184             return instance.InternalOvershoot;
185         });
186
187         /// <summary>
188         /// ScrollDirectionProperty
189         /// </summary>
190         [EditorBrowsable(EditorBrowsableState.Never)]
191         public static readonly BindableProperty ScrollDirectionProperty = BindableProperty.Create(nameof(ScrollDirection), typeof(Tizen.NUI.Vector2), typeof(ItemView), null, propertyChanged: (bindable, oldValue, newValue) =>
192         {
193             var instance = (Tizen.NUI.ItemView)bindable;
194             if (newValue != null)
195             {
196                 instance.InternalScrollDirection = (Tizen.NUI.Vector2)newValue;
197             }
198         },
199         defaultValueCreator: (bindable) =>
200         {
201             var instance = (Tizen.NUI.ItemView)bindable;
202             return instance.InternalScrollDirection;
203         });
204
205         /// <summary>
206         /// LayoutOrientationProperty
207         /// </summary>
208         [EditorBrowsable(EditorBrowsableState.Never)]
209         public static readonly BindableProperty LayoutOrientationProperty = BindableProperty.Create(nameof(LayoutOrientation), typeof(int), typeof(ItemView), 0, propertyChanged: (bindable, oldValue, newValue) =>
210         {
211             var instance = (Tizen.NUI.ItemView)bindable;
212             if (newValue != null)
213             {
214                 instance.InternalLayoutOrientation = (int)newValue;
215             }
216         },
217         defaultValueCreator: (bindable) =>
218         {
219             var instance = (Tizen.NUI.ItemView)bindable;
220             return instance.InternalLayoutOrientation;
221         });
222
223         /// <summary>
224         /// ScrollContentSizeProperty
225         /// </summary>
226         [EditorBrowsable(EditorBrowsableState.Never)]
227         public static readonly BindableProperty ScrollContentSizeProperty = BindableProperty.Create(nameof(ScrollContentSize), typeof(float), typeof(ItemView), default(float), propertyChanged: (bindable, oldValue, newValue) =>
228         {
229             var instance = (Tizen.NUI.ItemView)bindable;
230             if (newValue != null)
231             {
232                 instance.InternalScrollContentSize = (float)newValue;
233             }
234         },
235         defaultValueCreator: (bindable) =>
236         {
237             var instance = (Tizen.NUI.ItemView)bindable;
238             return instance.InternalScrollContentSize;
239         });
240     }
241 }