Skip to content

Instantly share code, notes, and snippets.

@SuperYeti
Created April 4, 2011 01:35
Show Gist options
  • Save SuperYeti/901027 to your computer and use it in GitHub Desktop.
Save SuperYeti/901027 to your computer and use it in GitHub Desktop.
[PATCH] Fixed BooleanElement so it updates the UISwitch when you change the value programmatically.
From 8f7ec5143379078481575e7a56b8c88b3753ace2 Mon Sep 17 00:00:00 2001
From: Warren Moxley <warren@it1services.ca>
Date: Sun, 3 Apr 2011 18:29:50 -0700
Subject: [PATCH] Fixed BooleanElement so it updates the UISwitch when you change the value programmatically.
---
MonoTouch.Dialog/Elements.cs | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/MonoTouch.Dialog/Elements.cs b/MonoTouch.Dialog/Elements.cs
index edac7b4..2b3de22 100644
--- a/MonoTouch.Dialog/Elements.cs
+++ b/MonoTouch.Dialog/Elements.cs
@@ -233,6 +233,10 @@ namespace MonoTouch.Dialog
Value = sw.On;
}, UIControlEvent.ValueChanged);
}
+ else
+ {
+ sw.On = Value;
+ }
var cell = tv.DequeueReusableCell (bkey);
if (cell == null){
--
1.7.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment