[NUI.Components] Fix Background Image not works issue (#1246)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Style / PaginationStyle.cs
1 /*
2  * Copyright(c) 2019 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.BaseComponents;
19 using Tizen.NUI.Binding;
20
21 namespace Tizen.NUI.Components
22 {
23     /// <summary>
24     /// PaginationStyle used to config the pagination represent.
25     /// </summary>
26     /// <since_tizen> 6 </since_tizen>
27     /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
28     [EditorBrowsable(EditorBrowsableState.Never)]
29     public class PaginationStyle : ControlStyle
30     {
31         static PaginationStyle() { }
32
33         /// <summary>
34         /// Creates a new instance of a PaginationStyle.
35         /// </summary>
36         /// <since_tizen> 6 </since_tizen>
37         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
38         [EditorBrowsable(EditorBrowsableState.Never)]
39         public PaginationStyle() : base() { }
40
41         /// <summary>
42         /// Creates a new instance of a PaginationStyle using style.
43         /// </summary>
44         /// <since_tizen> 6 </since_tizen>
45         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
46         [EditorBrowsable(EditorBrowsableState.Never)]
47         public PaginationStyle(PaginationStyle style) : base(style)
48         {
49             if (null == style) return;
50
51             this.CopyFrom(style);
52         }
53
54         /// <summary>
55         /// Gets or sets the size of the indicator.
56         /// </summary>
57         /// <since_tizen> 6 </since_tizen>
58         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
59         [EditorBrowsable(EditorBrowsableState.Never)]
60         public Size IndicatorSize
61         {
62             get;
63             set;
64         }
65
66         /// <summary>
67         /// Gets or sets the resource of indicator.
68         /// </summary>
69         /// <since_tizen> 6 </since_tizen>
70         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
71         [EditorBrowsable(EditorBrowsableState.Never)]
72         public Selector<string> IndicatorImageURL
73         {
74             get;
75             set;
76         } = new Selector<string>();
77
78         /// <summary>
79         /// Gets or sets the space of the indicator.
80         /// </summary>
81         /// <since_tizen> 6 </since_tizen>
82         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
83         [EditorBrowsable(EditorBrowsableState.Never)]
84         public int IndicatorSpacing
85         {
86             get;
87             set;
88         }
89
90         /// <summary>
91         /// Retrieves a copy of PaginationStyle.
92         /// </summary>
93         /// <since_tizen> 6 </since_tizen>
94         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
95         [EditorBrowsable(EditorBrowsableState.Never)]
96         public override void CopyFrom(BindableObject bindableObject)
97         {
98             base.CopyFrom(bindableObject);
99
100             PaginationStyle paginationStyle = bindableObject as PaginationStyle;
101             if (null != paginationStyle)
102             {
103                 if (null != paginationStyle.IndicatorSize)
104                 {
105                     IndicatorSize = new Size(paginationStyle.IndicatorSize.Width, paginationStyle.IndicatorSize.Height);
106                 }
107                 if (null != paginationStyle.IndicatorImageURL)
108                 {
109                     IndicatorImageURL.Clone(paginationStyle.IndicatorImageURL);
110                 }
111                 IndicatorSpacing = paginationStyle.IndicatorSpacing;
112             }
113         }
114     }
115 }