Skip to content

Instantly share code, notes, and snippets.

@wayne-o
Created January 28, 2014 10:53
Show Gist options
  • Save wayne-o/8665587 to your computer and use it in GitHub Desktop.
Save wayne-o/8665587 to your computer and use it in GitHub Desktop.
DebugEntryElement
public class DebugEntryElement : EntryElement{
Action<UITextField, EventArgs> onChange;
public DebugEntryElement(string caption, string placeholder, string value, Action<UITextField, EventArgs> onChange) : base(caption, placeholder, value)
{
this.onChange = onChange;
}
protected override UITextField CreateTextField(RectangleF frame)
{
var field = base.CreateTextField(frame);
field.EditingDidEnd += (object sender, EventArgs e) => {
if (onChange != null) {
onChange((UITextField)sender, e);
}
};
return field;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment