42e456cc11939b59932393b7d6a98a5f2a036da5
[profile/tv/apps/dotnet/home.git] / TVApps / TVApps / Views / FooterPinStatus.xaml.cs
1 /*
2  * Copyright (c) 2017 Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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 LibTVRefCommonPortable.Utils;
18 using System.Windows.Input;
19 using TVApps.Controls;
20 using Xamarin.Forms;
21
22 namespace TVApps.Views
23 {
24     /// <summary>
25     /// A custom view for displaying footer when CurrentStatus of MainPage is AppsStatus.Pin
26     /// </summary>
27     public partial class FooterPinStatus : RelativeLayout
28     {
29         private Button DoneButton;
30         //private Label SumOfCheckedAppLabel;
31         /*
32         /// <summary>
33         /// Identifies the SumOfCheckedApp bindable property
34         /// </summary>
35         public static readonly BindableProperty SumOfCheckedAppProperty = BindableProperty.Create("SumOfCheckedApp", typeof(int), typeof(FooterPinStatus), default(int));
36
37         /// <summary>
38         /// Gets or sets count of checked AppItemCell
39         /// </summary>
40         public int SumOfCheckedApp
41         {
42             get { return (int)GetValue(SumOfCheckedAppProperty); }
43             set { SetValue(SumOfCheckedAppProperty, value); }
44         }
45         */
46
47         /// <summary>
48         /// A constructor
49         /// </summary>
50         public FooterPinStatus()
51         {
52             InitializeComponent();
53
54             CreateDoneButton();
55             //CreateFooterAdditionalText();
56         }
57
58         /*
59         private void CreateFooterAdditionalText()
60         {
61             SetBinding(FooterPinStatus.SumOfCheckedAppProperty, new Binding("SumOfCheckedApp"));
62
63             SumOfCheckedAppLabel = new Label()
64             {
65                 Text = SumOfCheckedApp + " Pinned",
66                 WidthRequest = SizeUtils.GetWidthSize(600),
67                 HeightRequest = SizeUtils.GetHeightSize(32),
68                 FontSize = SizeUtils.GetFontSize(28),
69                 TextColor = Color.White,
70             };
71
72             this.Children.Add(SumOfCheckedAppLabel,
73                 heightConstraint: Constraint.Constant(SizeUtils.GetHeightSize(32)),
74                 widthConstraint: Constraint.Constant(SizeUtils.GetWidthSize(600)),
75                 yConstraint: Constraint.Constant(SizeUtils.GetHeightSize(762)),
76                 xConstraint: Constraint.Constant(SizeUtils.GetWidthSize(96)));
77
78             PropertyChanged += FooterPinStatusPropertyChanged;
79         }
80         */
81
82         private void CreateDoneButton()
83         {
84             DoneButton = new Button()
85             {
86                 Text = "Done",
87             };
88
89             DoneButton.SetBinding(Button.CommandProperty, new Binding("ButtonPinDoneCommand"));
90
91             this.Children.Add(DoneButton,
92                 heightConstraint: Constraint.Constant(SizeUtils.GetHeightSize(80)),
93                 widthConstraint: Constraint.Constant(SizeUtils.GetWidthSize(300)),
94                 yConstraint: Constraint.Constant(SizeUtils.GetHeightSize(762)),
95                 xConstraint: Constraint.Constant(SizeUtils.GetWidthSize(96 + 1130 + 300 + 2)));
96        }
97
98         public Button GetDoneButton()
99         {
100             return DoneButton;
101         }
102
103         /*
104         private void FooterPinStatusPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
105         {
106             if (e.PropertyName.Equals("SumOfCheckedApp"))
107             {
108                 SumOfCheckedAppLabel.Text = SumOfCheckedApp + " Pinned";
109             }
110         }*/
111     }
112 }