2 * Copyright (c) 2017 Samsung Electronics Co., Ltd
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
8 * http://floralicense.org/license/
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.
17 using LibTVRefCommonPortable.Utils;
18 using System.Windows.Input;
19 using TVApps.Controls;
22 namespace TVApps.Views
25 /// A custom view for displaying footer when CurrentStatus of MainPage is AppsStatus.Pin
27 public partial class FooterPinStatus : RelativeLayout
29 private Button DoneButton;
30 //private Label SumOfCheckedAppLabel;
33 /// Identifies the SumOfCheckedApp bindable property
35 public static readonly BindableProperty SumOfCheckedAppProperty = BindableProperty.Create("SumOfCheckedApp", typeof(int), typeof(FooterPinStatus), default(int));
38 /// Gets or sets count of checked AppItemCell
40 public int SumOfCheckedApp
42 get { return (int)GetValue(SumOfCheckedAppProperty); }
43 set { SetValue(SumOfCheckedAppProperty, value); }
50 public FooterPinStatus()
52 InitializeComponent();
55 //CreateFooterAdditionalText();
59 private void CreateFooterAdditionalText()
61 SetBinding(FooterPinStatus.SumOfCheckedAppProperty, new Binding("SumOfCheckedApp"));
63 SumOfCheckedAppLabel = new Label()
65 Text = SumOfCheckedApp + " Pinned",
66 WidthRequest = SizeUtils.GetWidthSize(600),
67 HeightRequest = SizeUtils.GetHeightSize(32),
68 FontSize = SizeUtils.GetFontSize(28),
69 TextColor = Color.White,
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)));
78 PropertyChanged += FooterPinStatusPropertyChanged;
82 private void CreateDoneButton()
84 DoneButton = new Button()
89 DoneButton.SetBinding(Button.CommandProperty, new Binding("ButtonPinDoneCommand"));
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)));
98 public Button GetDoneButton()
104 private void FooterPinStatusPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
106 if (e.PropertyName.Equals("SumOfCheckedApp"))
108 SumOfCheckedAppLabel.Text = SumOfCheckedApp + " Pinned";