2 * Copyright(c) 2022 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 using System.ComponentModel;
20 using Tizen.NUI.BaseComponents;
21 using Tizen.NUI.Components;
23 namespace Tizen.NUI.StyleGuide
25 // IExample inehrited class will be automatically added in the main examples list.
26 internal class DatePickerExample : ContentPage, IExample
28 private View rootContent;
29 private DatePicker datePicker;
30 private TextLabel label;
31 private Button button;
33 public void Activate()
36 public void Deactivate()
40 /// Modify this method for adding other examples.
41 public DatePickerExample() : base()
43 WidthSpecification = LayoutParamPolicies.MatchParent;
44 HeightSpecification = LayoutParamPolicies.MatchParent;
46 // Navigator bar title is added here.
49 Title = "DatePicker Default Style",
52 // Example root content view.
53 // you can decorate, add children on this view.
54 rootContent = new View()
56 WidthSpecification = LayoutParamPolicies.MatchParent,
57 HeightSpecification = LayoutParamPolicies.MatchParent,
59 Layout = new LinearLayout()
61 LinearOrientation = LinearLayout.Orientation.Vertical,
62 HorizontalAlignment = HorizontalAlignment.Center,
63 VerticalAlignment = VerticalAlignment.Center,
64 CellPadding = new Size2D(10, 20),
68 // Picker style examples.
69 datePicker = new DatePicker()
71 WidthSpecification = LayoutParamPolicies.MatchParent,
74 rootContent.Add(datePicker);
79 WidthSpecification = LayoutParamPolicies.MatchParent,
80 Text = $"Date: {datePicker.Date.ToString()}"
82 rootContent.Add(label);
84 button = new Tizen.NUI.Components.Button
86 WidthSpecification = LayoutParamPolicies.MatchParent,
89 rootContent.Add(button);
91 button.Clicked += (s, e) =>
93 label.Text = $"Date: {datePicker.Date.ToString()}";
96 Content = rootContent;