|
@@ -26,15 +26,16 @@ namespace InABox.Mobile
|
|
|
public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(MobileToolItem), "");
|
|
|
public string Text
|
|
|
{
|
|
|
- get { return (string)GetValue(TextProperty); }
|
|
|
- set { SetValue(TextProperty, value); }
|
|
|
+ get => (string)GetValue(TextProperty);
|
|
|
+ set => SetValue(TextProperty, value);
|
|
|
}
|
|
|
|
|
|
public static readonly BindableProperty ImageProperty = BindableProperty.Create(nameof(Image), typeof(ImageSource), typeof(MobileToolItem), null);
|
|
|
public ImageSource Image
|
|
|
{
|
|
|
- get { return (ImageSource)GetValue(ImageProperty); }
|
|
|
- set { SetValue(ImageProperty, value); }
|
|
|
+ get => (ImageSource)GetValue(ImageProperty);
|
|
|
+ set =>SetValue(ImageProperty, value);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public static readonly BindableProperty AlertProperty = BindableProperty.Create(
|
|
@@ -44,8 +45,9 @@ namespace InABox.Mobile
|
|
|
null);
|
|
|
public string Alert
|
|
|
{
|
|
|
- get { return (string)GetValue(AlertProperty); }
|
|
|
- set {
|
|
|
+ get => (string)GetValue(AlertProperty);
|
|
|
+ set
|
|
|
+ {
|
|
|
SetValue(AlertProperty, value);
|
|
|
OnPropertyChanged(nameof(AlertVisible));
|
|
|
}
|
|
@@ -74,7 +76,7 @@ namespace InABox.Mobile
|
|
|
public Color TextColor
|
|
|
{
|
|
|
get => (Color)GetValue(TextColorProperty);
|
|
|
- set => SetValue(TextColorProperty, value);
|
|
|
+ set => SetValue(TextColorProperty, value);
|
|
|
}
|
|
|
|
|
|
public static readonly BindableProperty IsEnabledProperty = BindableProperty.Create(nameof(IsEnabled), typeof(bool), typeof(MobileToolItem), true);
|
|
@@ -83,8 +85,10 @@ namespace InABox.Mobile
|
|
|
get { return (bool)GetValue(IsEnabledProperty); }
|
|
|
set
|
|
|
{
|
|
|
+ var old = (bool)GetValue(IsEnabledProperty);
|
|
|
SetValue(IsEnabledProperty, value);
|
|
|
- DoChanged();
|
|
|
+ if (old != value)
|
|
|
+ DoEnabledChanged();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -95,8 +99,10 @@ namespace InABox.Mobile
|
|
|
get { return (bool)GetValue(IsVisibleProperty); }
|
|
|
set
|
|
|
{
|
|
|
+ var old = (bool)GetValue(IsVisibleProperty);
|
|
|
SetValue(IsVisibleProperty, value);
|
|
|
- DoChanged();
|
|
|
+ if (old != value)
|
|
|
+ DoVisibleChanged();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -104,17 +110,18 @@ namespace InABox.Mobile
|
|
|
public static readonly BindableProperty RowProperty = BindableProperty.Create(nameof(Row), typeof(Int32), typeof(MobileToolItem));
|
|
|
public Int32 Row
|
|
|
{
|
|
|
- get { return (Int32)GetValue(RowProperty); }
|
|
|
- set { SetValue(RowProperty, value); }
|
|
|
+ get => (Int32)GetValue(RowProperty);
|
|
|
+ set => SetValue(RowProperty, value);
|
|
|
}
|
|
|
|
|
|
public static readonly BindableProperty ColumnProperty = BindableProperty.Create(nameof(Column), typeof(Int32), typeof(MobileToolItem));
|
|
|
+
|
|
|
public Int32 Column
|
|
|
{
|
|
|
- get { return (Int32)GetValue(ColumnProperty); }
|
|
|
- set { SetValue(ColumnProperty, value); }
|
|
|
+ get => (Int32)GetValue(ColumnProperty);
|
|
|
+ set => SetValue(ColumnProperty, value);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public int ID { get; set; }
|
|
|
|
|
|
public event EventHandler Clicked;
|
|
@@ -125,11 +132,18 @@ namespace InABox.Mobile
|
|
|
}
|
|
|
|
|
|
|
|
|
- public event EventHandler Changed;
|
|
|
+ public event EventHandler VisibleChanged;
|
|
|
+
|
|
|
+ public void DoVisibleChanged()
|
|
|
+ {
|
|
|
+ VisibleChanged?.Invoke(this, EventArgs.Empty);
|
|
|
+ }
|
|
|
+
|
|
|
+ public event EventHandler EnabledChanged;
|
|
|
|
|
|
- public void DoChanged()
|
|
|
+ public void DoEnabledChanged()
|
|
|
{
|
|
|
- Changed?.Invoke(this, EventArgs.Empty);
|
|
|
+ EnabledChanged?.Invoke(this, EventArgs.Empty);
|
|
|
}
|
|
|
|
|
|
|