Fix checkbox IsChecked property

This commit is contained in:
Frank A. Krueger 2018-02-02 19:51:35 -08:00
parent 957f9d7333
commit 8c97a625e1
No known key found for this signature in database
GPG Key ID: 0471C67474FFE664
2 changed files with 2 additions and 6 deletions

View File

@ -116,7 +116,7 @@ namespace Ooui
protected bool SetBooleanAttributeProperty (string attributeName, bool newValue, [System.Runtime.CompilerServices.CallerMemberName] string propertyName = "")
{
var old = GetAttribute (attributeName) != null;
if (old != newValue)
if (old == newValue)
return false;
if (newValue)
SetAttribute (attributeName, string.Empty);

View File

@ -40,11 +40,7 @@ namespace Ooui
public bool IsChecked {
get => GetBooleanAttribute ("checked");
set {
if (SetBooleanAttributeProperty ("checked", value)) {
TriggerEventFromMessage (Message.Event (Id, "change", IsChecked));
}
}
set => SetBooleanAttributeProperty ("checked", value);
}
public double Minimum {