WPF IDataErrorInfo multiple field check

What is a good way to integrate multiple field checks using IDataErrorInfo?

Say I have a dialog with 3 text fields for ftp information

  • URL
  • Username
  • Password

I put the Required attribute in the fields (suppose plain text for the password).

I check the ftp connection when the user clicks "OK". I am showing a dialog at the moment, but it would be nice if I could call the style of the validation error for ftp connection errors.

I looked at Validation.MarkInvalid, but don’t understand how to use it.

var be = GetBindingExpression(xamlURLField);
Validation.MarkInvalid(be, new ValidationError(-- WhatValidationRuleToPutHere --, be, "Can't connect to ftp", null)
0
source share
1 answer

. . - , , , "". - , , .

.

+1

Source: https://habr.com/ru/post/1751791/


All Articles