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 = "") 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);

View File

@ -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 {