Fix checkbox IsChecked property
This commit is contained in:
parent
957f9d7333
commit
8c97a625e1
|
@ -116,7 +116,7 @@ namespace Ooui
|
||||||
protected bool SetBooleanAttributeProperty (string attributeName, bool newValue, [System.Runtime.CompilerServices.CallerMemberName] string propertyName = "")
|
protected bool SetBooleanAttributeProperty (string attributeName, bool newValue, [System.Runtime.CompilerServices.CallerMemberName] string propertyName = "")
|
||||||
{
|
{
|
||||||
var old = GetAttribute (attributeName) != null;
|
var old = GetAttribute (attributeName) != null;
|
||||||
if (old != newValue)
|
if (old == newValue)
|
||||||
return false;
|
return false;
|
||||||
if (newValue)
|
if (newValue)
|
||||||
SetAttribute (attributeName, string.Empty);
|
SetAttribute (attributeName, string.Empty);
|
||||||
|
|
|
@ -40,11 +40,7 @@ namespace Ooui
|
||||||
|
|
||||||
public bool IsChecked {
|
public bool IsChecked {
|
||||||
get => GetBooleanAttribute ("checked");
|
get => GetBooleanAttribute ("checked");
|
||||||
set {
|
set => SetBooleanAttributeProperty ("checked", value);
|
||||||
if (SetBooleanAttributeProperty ("checked", value)) {
|
|
||||||
TriggerEventFromMessage (Message.Event (Id, "change", IsChecked));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public double Minimum {
|
public double Minimum {
|
||||||
|
|
Loading…
Reference in New Issue