I have a page where a few textboxes cannot be empty before clicking a Save button.
I've tried several of the solutions stated above; however, none of them worked for me.
I have a simple input window that request a URI from the user, if the TextBox value isn't a valid Uri then the Okay button should be disabled.
Here is what worked for me:
CommandBindings.Add(new CommandBinding(AppCommands.Okay,
(sender, args) => DialogResult = true,
(sender, args) => args.CanExecute = !(bool) _uriTextBoxControl.GetValue(Validation.HasErrorProperty)));