diff options
author | JH Choi <jjie.choi@samsung.com> | 2017-09-27 05:36:18 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.ap-northeast-2.compute.internal> | 2017-09-27 05:36:18 +0000 |
commit | 864ff718ef798904e8171986f3fe23c52cedd901 (patch) | |
tree | c2e902aad45feac5163fe2bb41db778792501df0 | |
parent | c7ecedfd38ff156a480964ee5bfd3d8f7c9dd020 (diff) | |
parent | 4c57983da40b64fe566c2b003a5cf95c49371a83 (diff) | |
download | home-864ff718ef798904e8171986f3fe23c52cedd901.tar.gz home-864ff718ef798904e8171986f3fe23c52cedd901.tar.bz2 home-864ff718ef798904e8171986f3fe23c52cedd901.zip |
Merge "Changed to disable option button if there are no installed applications" into tizen
-rw-r--r-- | TVApps/TVApps/Controls/EnableStateConverter.cs | 22 | ||||
-rwxr-xr-x | TVApps/TVApps/Views/FooterNormalStatus.xaml.cs | 4 |
2 files changed, 26 insertions, 0 deletions
diff --git a/TVApps/TVApps/Controls/EnableStateConverter.cs b/TVApps/TVApps/Controls/EnableStateConverter.cs new file mode 100644 index 0000000..2908c48 --- /dev/null +++ b/TVApps/TVApps/Controls/EnableStateConverter.cs @@ -0,0 +1,22 @@ +using LibTVRefCommonPortable.DataModels; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Text; +using Xamarin.Forms; + +namespace TVApps.Controls +{ + class EnableStateConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return ((List<AppShortcutInfo>)value).Count > 0; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/TVApps/TVApps/Views/FooterNormalStatus.xaml.cs b/TVApps/TVApps/Views/FooterNormalStatus.xaml.cs index 07bc4fd..bc133d1 100755 --- a/TVApps/TVApps/Views/FooterNormalStatus.xaml.cs +++ b/TVApps/TVApps/Views/FooterNormalStatus.xaml.cs @@ -20,6 +20,7 @@ using LibTVRefCommonPortable.Utils; using System.Windows.Input; using System; using System.Collections.Generic; +using TVApps.Controls; namespace TVApps.Views { @@ -124,6 +125,9 @@ namespace TVApps.Views FontSize = SizeUtils.GetFontSize(28), }; OptionButton.Clicked += OnOptionsClicked; + Binding binding = new Binding("InstalledAppList"); + binding.Converter = new EnableStateConverter(); + OptionButton.SetBinding(Button.IsEnabledProperty, binding); this.Children.Add(OptionButton, heightConstraint: Constraint.Constant(SizeUtils.GetHeightSize(80)), |