[NUI] Refactoring Theme and StyleManager (#1981)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Wearable / src / public / WearableStyle / PopupStyle.cs
1 /*
2  * Copyright(c) 2020 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 using System.ComponentModel;
18 using Tizen.NUI.Binding;
19 using Tizen.NUI.Components;
20
21 namespace Tizen.NUI.Wearable
22 {
23     /// <summary>
24     /// PopupStyle used to config the Popup represent.
25     /// </summary>
26     [EditorBrowsable(EditorBrowsableState.Never)]
27     public class PopupStyle : ControlStyle
28     {
29         /// <summary>Bindable property of WrapContent</summary>
30         [EditorBrowsable(EditorBrowsableState.Never)]
31         public static readonly BindableProperty WrapContentProperty = BindableProperty.Create(nameof(WrapContent), typeof(bool?), typeof(PopupStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
32         {
33             ((PopupStyle)bindable).wrapContent = (bool?)newValue;
34         },
35         defaultValueCreator: (bindable) =>
36         {
37             return ((PopupStyle)bindable).wrapContent;
38         });
39
40         private bool? wrapContent;
41
42         static PopupStyle() { }
43
44         /// <summary>
45         /// Creates a new instance of a PopupStyle.
46         /// </summary>
47         [EditorBrowsable(EditorBrowsableState.Never)]
48         public PopupStyle() : base()
49         {
50             initSubStyle();
51         }
52
53         /// <summary>
54         /// Creates a new instance of a PopupStyle using style.
55         /// </summary>
56         [EditorBrowsable(EditorBrowsableState.Never)]
57         public PopupStyle(PopupStyle style) : base(style)
58         {
59         }
60
61         /// <summary>
62         /// WrapContent
63         /// </summary>
64         [EditorBrowsable(EditorBrowsableState.Never)]
65         public bool? WrapContent
66         {
67             get => (bool?)GetValue(WrapContentProperty);
68             set => SetValue(WrapContentProperty, value);            
69         }
70
71         private void initSubStyle()
72         {
73             WrapContent = false;
74             //to do
75             Size = new Size(10, 10);
76         }
77
78     }
79 }