Hi, we are trying to run some validation from within a view model, the idea is that the main window shouldn't be closed if something is not valid... currently we are trying using some validation rules and some custom service but calling 'DoValidate' doesn't seem to work (there are some 'WinForms' related questions that seem to set 'IsModified = true' but that doesn't seem to exist in wpf)
TextEdit's DoValidate method launches TextEdit's validation logic - the Validate event. A binding with validation rules is the standard WPF approach that is used at the binding level. So, the DoValidate method doesn't affect it.
To accomplish this task, you can use common approaches like the one described in the Force validation on bound controls in WPF or Accessing WPF control validation rules from code thread.