Keep validation adornment visibility up to date#285
Conversation
The `ShowValidateError` method wasn't getting called to update the validation adorner when `ValidationMessage.ShowError` changes independent of a `TextChanged` or focus event. I'm not sure if this should be done here or in the `WhenAny` above which updates `ShowError` - I've put it here as that's where the existing call to ShowValidateError is.
|
Actually, I'm not sure why the validation adornment is updated only on |
|
I don't recall at all unfortunately. Maybe the others can remember. |
|
@shana @grokys I'm also struggling to recall the context, but from memory listening to The only place I can see subscribing to this is here ( this.WhenAny(x => x.ValidatesControl, x => x.Value)
.WhereNotNull()
.Select(control =>
this.WhenAny(x => x.ShowError, x => x.Value)
.DistinctUntilChanged()
.SelectMany(showError =>
Observable.Return(showError)
.Throttle(TimeSpan.FromSeconds(showError ? defaultTextChangeThrottle : TextChangeThrottle))))
.Switch()
.Subscribe(showError =>
{
IsShowingMessage = showError;
Visibility = IsShowingMessage ? Visibility.Visible : Visibility.Hidden;
});Those two properties in the subscription are just dependency properties, nothing fancy there. |
|
Ok, so feels like we just need to make extra sure we don't regress anything. @mponce1 When the testing for the next release happens, besides just testing for #242, could you also test other places where errors should show up in the login, clone, creation and publish dialogs. This fix affects all of them. Stuff like:
|
Fix for issue #242
The
ShowValidateErrormethod wasn't getting called to update the validation adorner whenValidationMessage.ShowErrorchanges independent of aTextChangedor focus event.I'm not sure if this should be done here or in the
WhenAnyabove which updatesShowError- I've put it here as that's where the existing call to ShowValidateError is.