public void AddKeyPressEventHandler(TextBoxMapper mapper, IBOProp boProp) { BoProp = boProp; var tb = mapper.GetControl() as TextBox; if (tb != null) { tb.KeyPress += KeyPressEventHandler; TextBoxControl = tb; } }