[NUI] Add bindable properties to Components.
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Controls / RecyclerView / Item / DefaultTitleItemBindableProperty.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 DefaultTitleItem
8     {
9         /// <summary>
10         /// IconProperty
11         /// </summary>
12         [EditorBrowsable(EditorBrowsableState.Never)]
13         public static readonly BindableProperty IconProperty = BindableProperty.Create(nameof(Icon), typeof(View), typeof(DefaultTitleItem), null, propertyChanged: (bindable, oldValue, newValue) =>
14         {
15             var instance = (DefaultTitleItem)bindable;
16             if (newValue != null)
17             {
18                 instance.InternalIcon = newValue as View;
19             }
20         },
21         defaultValueCreator: (bindable) =>
22         {
23             var instance = (DefaultTitleItem)bindable;
24             return instance.InternalIcon;
25         });
26
27         /// <summary>
28         /// TextProperty
29         /// </summary>
30         [EditorBrowsable(EditorBrowsableState.Never)]
31         public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(DefaultTitleItem), default(string), propertyChanged: (bindable, oldValue, newValue) =>
32         {
33             var instance = (DefaultTitleItem)bindable;
34             if (newValue != null)
35             {
36                 instance.InternalText = newValue as string;
37             }
38         },
39         defaultValueCreator: (bindable) =>
40         {
41             var instance = (DefaultTitleItem)bindable;
42             return instance.InternalText;
43         });
44     }
45 }