public void AddUpdateBoPropOnTextChangedHandler(TextBoxMapper mapper, IBOProp boProp) { BoProp = boProp; _mapper = mapper; var tb = mapper.GetControl() as TextBox; if (tb != null) { tb.TextChanged += UpdateBoPropWithTextFromTextBox; TextBoxControl = tb; } }
/// <summary> /// Adds key press event handlers that carry out actions like /// limiting the input of certain characters, depending on the type of the /// property /// </summary> /// <param name="mapper">The TextBox mapper</param> /// <param name="boProp">The property being mapped</param> public void AddKeyPressEventHandler(TextBoxMapper mapper, IBOProp boProp) { BoProp = boProp; var tb = mapper.GetControl() as TextBox; if (tb != null) { tb.KeyPress += KeyPressEventHandler; TextBoxControl = tb; } }