summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TVApps/TVApps/Controls/EnableStateConverter.cs22
-rwxr-xr-xTVApps/TVApps/Views/FooterNormalStatus.xaml.cs4
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)),