void EntryValidation_Changed(object sender, EventArgs e) { if (_maxLength > 0 || _maxWords > 0) { ValidateMaxLenghtMaxWordsResult result = FrameworkUtils.ValidateMaxLenghtMaxWords(Text, _initialLabelText, _maxLength, _maxWords); Text = result.Text; Label.Text = result.LabelText; _length = result.Length; _words = result.Words; } }
void Value_Changed(object sender, EventArgs e) { if (_maxLength > 0 || _maxWords > 0) { ValidateMaxLenghtMaxWordsResult result = FrameworkUtils.ValidateMaxLenghtMaxWords(_entryMultiline.Value.Text, _initialLabelText, _maxLength, _maxWords); //Only update if changes else infinite loop if (_entryMultiline.Value.Text != result.Text) { _entryMultiline.Value.Text = result.Text; } Label.Text = result.LabelText; _length = result.Length; _words = result.Words; } //Now we can validate after ValidateMaxLenghtMaxWords Work Validate(); }