migueldeicaza/MonoTouch.Dialog — Issue #84: BooleanElement don't updates the UISwitch when you change the value programmatically. Previous Issue #44
Author: satya007satya
Created: 2011-12-28 06:43:17+00:00
State: open

It's interesting to see that this bug which was closed earlier is still not fixed, might be because the code has been re written or whatever.. Fix need to be applied in repository

Two changes were needed
1. Made value as virtual in BoolElement Class

public virtual bool Value

2. Added override for value in BooleanElement
public override bool Value {
get {
return base.Value;
}
set {
base.Value = value;
if(value)
{
sw.On = true;
}
else
{
sw.On = false;
}
}
}