I use prism and mvvm. There is a form editor for creating and changing the entity. For fields I use validation using IDataErrorInfo.
<TextBox Text="{Binding Name, ValidatesOnDataErrors=True}" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}"/> public string this[string propertyName] { get { var error = string.Empty; switch (propertyName) { case "Name": return this.ValidateNameValue(); break; } return error; } } The problem is that when creating a new entity, all fields have default values (null / string.Empty). As a result, when opening a form for these fields, validation errors are displayed. How to achieve that validation would be started only after user input of data?
If there is at least one invalid field, then the "Submit" button is inactive. When all fields become valid, the button is activated. If the user entered valid data, and then canceled the input, the form becomes invalid and the button is disabled.
The only thing that needs to be changed is that when creating a new entity, input fields should not display the ErrorTemplate template.