Unify disable logic.

This commit is contained in:
Dean Herbert 2017-04-10 16:22:36 +09:00
parent b7cfdff8d1
commit f12b5a8954
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
4 changed files with 8 additions and 11 deletions

View File

@ -24,11 +24,8 @@ public Bindable<bool> Bindable
set
{
bindable = value;
if (bindable != null)
Current = bindable;
if (bindable?.Disabled ?? true)
Current = bindable;
if (value?.Disabled ?? true)
Alpha = 0.3f;
}
}

View File

@ -34,7 +34,7 @@ public Bindable<T> Bindable
{
bindable = value;
dropdown.Current = bindable;
if (bindable.Disabled)
if (value?.Disabled ?? true)
Alpha = 0.3f;
}
}

View File

@ -27,12 +27,14 @@ public string LabelText
}
}
private Bindable<T> bindable;
public Bindable<T> Bindable
{
get { return slider.Current; }
set
{
slider.Current = value;
bindable = value;
slider.Current = bindable;
if (value?.Disabled ?? true)
Alpha = 0.3f;
}

View File

@ -15,10 +15,8 @@ public Bindable<string> Bindable
set
{
bindable = value;
Current = bindable;
if (bindable?.Disabled ?? true)
if (value?.Disabled ?? true)
Alpha = 0.3f;
}
}