diff options
author | JH Choi <jjie.choi@samsung.com> | 2017-09-27 14:10:25 +0900 |
---|---|---|
committer | JH Choi <jjie.choi@samsung.com> | 2017-09-27 14:10:25 +0900 |
commit | 4c57983da40b64fe566c2b003a5cf95c49371a83 (patch) | |
tree | 8a686bf2d8b37b47b5b5d9438df41cf06239ba98 | |
parent | e7f2250c8fb1d0599d1e485c09f6a905f5680471 (diff) | |
download | home-4c57983da40b64fe566c2b003a5cf95c49371a83.tar.gz home-4c57983da40b64fe566c2b003a5cf95c49371a83.tar.bz2 home-4c57983da40b64fe566c2b003a5cf95c49371a83.zip |
Changed to disable option button if there are no installed applications
Signed-off-by: JH Choi <jjie.choi@samsung.com>
i
Change-Id: Ia9480f341253cd54094790a0a146d3464a25a376
-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)), |