Created
January 28, 2014 10:53
-
-
Save wayne-o/8665587 to your computer and use it in GitHub Desktop.
DebugEntryElement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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