Replace duplicate documentation of CopyFrom with inheritdoc
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Style / Navigation / AppBarStyle.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 using System.ComponentModel;
18 using Tizen.NUI.BaseComponents;
19 using Tizen.NUI.Binding;
20
21 namespace Tizen.NUI.Components
22 {
23     /// <summary>
24     /// AppBarStyle is a class which saves AppBar's ux data.
25     /// </summary>
26     /// <since_tizen> 9 </since_tizen>
27     public class AppBarStyle : ControlStyle
28     {
29         [EditorBrowsable(EditorBrowsableState.Never)]
30         static AppBarStyle() { }
31
32         /// <summary>
33         /// Creates a new instance of an AppBarStyle.
34         /// </summary>
35         /// <since_tizen> 9 </since_tizen>
36         public AppBarStyle() : base()
37         {
38         }
39
40         /// <summary>
41         /// Creates a new instance of an AppBarStyle with style.
42         /// The given style is copied to the new instance.
43         /// </summary>
44         /// <param name="style">Creates AppBarStyle by style customized by user.</param>
45         /// <since_tizen> 9 </since_tizen>
46         public AppBarStyle(AppBarStyle style) : base(style)
47         {
48         }
49
50         /// <summary>
51         /// Gets or sets the AppBar Back Button style.
52         /// </summary>
53         /// <since_tizen> 9 </since_tizen>
54         public ButtonStyle BackButton { get; set; } = new ButtonStyle();
55
56         /// <summary>
57         /// Gets or sets the AppBar Title TextLabel style.
58         /// This style is applied if AppBar Title is a TextLabel.
59         /// </summary>
60         /// <since_tizen> 9 </since_tizen>
61         public TextLabelStyle TitleTextLabel { get; set; } = new TextLabelStyle();
62
63         /// <summary>
64         /// Gets or sets the AppBar Action View style.
65         /// This style is applied if AppBar ActionContent's child is a View.
66         /// </summary>
67         /// <since_tizen> 9 </since_tizen>
68         public ViewStyle ActionView { get; set; } = new ViewStyle();
69
70         /// <summary>
71         /// Gets or sets the AppBar Action Button style.
72         /// This style is applied if AppBar ActionContent's child is a Button.
73         /// </summary>
74         /// <since_tizen> 9 </since_tizen>
75         public ButtonStyle ActionButton { get; set; } = new ButtonStyle();
76
77         /// <summary>
78         /// Navigation padding in AppBar.
79         /// This works only when NavigationContent is visible.
80         /// </summary>
81         [EditorBrowsable(EditorBrowsableState.Never)]
82         public Extents NavigationPadding { get; set; } = new Extents();
83
84         /// <summary>
85         /// Action padding in AppBar.
86         /// This works only when ActionContent is visible.
87         /// </summary>
88         [EditorBrowsable(EditorBrowsableState.Never)]
89         public Extents ActionPadding { get; set; } = new Extents();
90
91         /// <summary>
92         /// Cell padding among Actions in AppBar.
93         /// This works only when ActionContent is visible.
94         /// </summary>
95         [EditorBrowsable(EditorBrowsableState.Never)]
96         public Size2D ActionCellPadding { get; set; } = new Size2D();
97
98         /// <inheritdoc/>
99         /// <since_tizen> 9 </since_tizen>
100         public override void CopyFrom(BindableObject bindableObject)
101         {
102             base.CopyFrom(bindableObject);
103
104             if (bindableObject is AppBarStyle appBarStyle)
105             {
106                 BackButton.CopyFrom(appBarStyle.BackButton);
107                 TitleTextLabel.CopyFrom(appBarStyle.TitleTextLabel);
108                 ActionView.CopyFrom(appBarStyle.ActionView);
109                 ActionButton.CopyFrom(appBarStyle.ActionButton);
110                 NavigationPadding = (appBarStyle.NavigationPadding == null) ? new Extents() : new Extents(appBarStyle.NavigationPadding);
111                 ActionPadding = (appBarStyle.ActionPadding == null) ? new Extents() : new Extents(appBarStyle.ActionPadding);
112                 ActionCellPadding = (appBarStyle.ActionCellPadding == null) ? new Size2D() : new Size2D(appBarStyle.ActionCellPadding.Width, appBarStyle.ActionCellPadding.Height);
113             }
114         }
115     }
116 }