From 2918f39f160af3135232a23ce4b00f0c50c64d4f Mon Sep 17 00:00:00 2001 From: "Geunsun, Lee" Date: Thu, 23 Mar 2017 18:41:06 +0900 Subject: [PATCH] Implement app option menu logic Change-Id: I05082b66b5e9e109966f1dcfcc29c3301545d894 --- .../DataModels/AppShortcutInfo.cs | 45 ++-- TVApps/TVApps/Controls/AppItemCell.xaml | 38 ++-- TVApps/TVApps/Controls/AppItemCell.xaml.cs | 116 ++++------- TVApps/TVApps/Controls/AppListView.xaml.cs | 9 +- TVApps/TVApps/ViewModels/AppsHolder.cs | 44 +++- TVApps/TVApps/ViewModels/MainPageViewModel.cs | 28 +-- TVApps/TVApps/Views/FooterPinStatus.xaml | 16 +- TVApps/TVApps/Views/MainPage.xaml | 227 ++++++++++----------- TVApps/TVApps/Views/MainPage.xaml.cs | 4 +- 9 files changed, 257 insertions(+), 270 deletions(-) diff --git a/LibTVRefCommonPortable/DataModels/AppShortcutInfo.cs b/LibTVRefCommonPortable/DataModels/AppShortcutInfo.cs index 2e369c2..1caaf85 100644 --- a/LibTVRefCommonPortable/DataModels/AppShortcutInfo.cs +++ b/LibTVRefCommonPortable/DataModels/AppShortcutInfo.cs @@ -14,8 +14,10 @@ * limitations under the License. */ +using LibTVRefCommonPortable.Utils; using System; using System.Xml.Serialization; +using Xamarin.Forms; namespace LibTVRefCommonPortable.DataModels { @@ -24,6 +26,9 @@ namespace LibTVRefCommonPortable.DataModels public string AppID { get; set; } [XmlIgnore] + public string Status { get; set; } + + [XmlIgnore] private bool isChecked; [XmlIgnore] @@ -69,27 +74,6 @@ namespace LibTVRefCommonPortable.DataModels public bool IsRemovable { get; set; } [XmlIgnore] - private bool isVisible = true; - - [XmlIgnore] - public bool IsVisible - { - get - { - return isVisible; - } - - set - { - if (isVisible != value) - { - isVisible = value; - OnPropertyChanged("IsVisible"); - } - } - } - - [XmlIgnore] private bool isFocused; [XmlIgnore] @@ -158,6 +142,25 @@ namespace LibTVRefCommonPortable.DataModels [XmlIgnore] public DateTime LastUsed { get; set; } + [XmlIgnore] + public Command OptionMenuPinToggleCommand { get; set; } + + [XmlIgnore] + public Command OptionMenuDeleteCommand { get; set; } + + public AppShortcutInfo() + { + OptionMenuPinToggleCommand = new Command(() => + { + MessagingCenter.Send(this, "OptionMenuPinToggle", AppID); + }); + + OptionMenuDeleteCommand = new Command(() => + { + MessagingCenter.Send(this, "OptionMenuDelete", AppID); + }); + } + public override void UpdateState() { SetCurrentState("default"); diff --git a/TVApps/TVApps/Controls/AppItemCell.xaml b/TVApps/TVApps/Controls/AppItemCell.xaml index a5fd78d..14ab44e 100755 --- a/TVApps/TVApps/Controls/AppItemCell.xaml +++ b/TVApps/TVApps/Controls/AppItemCell.xaml @@ -2,6 +2,7 @@ + @@ -10,7 +11,6 @@ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.6833}" RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.2923}" RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.1583}" - IsVisible="{Binding IsVisible}" Source="{Binding CurrentStateDescription.IconPath}" /> - - - - - - 0 -