フォームにエラー プロバイダーがあり、そのデータ ソースはレコード クラスのエラーのコレクションにバインドされています。
検証は期待どおりに機能していますが、フォーム コントロールの横に赤い点滅アイコンが表示されません。私のレコードは IDataErrorInfo を実装しています:
Public ReadOnly Property [Error] As String Implements IDataErrorInfo.Error
Get
If _Errors.Count > 0 Then
Return String.Format("The record cannot be saved because there are {0} errors", _Errors.Count)
Else
Return String.Empty
End If
End Get
End Property
''' <summary>
''' Gets an error message for the property with the given name
''' </summary>
''' <value></value>
''' <returns></returns>
Default Public ReadOnly Property PropertyError(fieldName As String) As String Implements IDataErrorInfo.Item
Get
If _Errors.ContainsKey(fieldName) Then
Return _Errors(fieldName).ToString
Else
Return String.Empty
End If
End Get
End Property
私は完全に立ち往生しているので、どんな考えでも大歓迎です。