BindingGroup.NotifyOnValidationError 속성

정의

Error의 상태가 변경될 때 ValidationRule 이벤트가 발생하는지 여부를 가져오거나 설정합니다.

public:
 property bool NotifyOnValidationError { bool get(); void set(bool value); };
public bool NotifyOnValidationError { get; set; }
member this.NotifyOnValidationError : bool with get, set
Public Property NotifyOnValidationError As Boolean

속성 값

Error의 상태가 변경될 때 ValidationRule 이벤트가 발생하면 true이고, 그렇지 않으면 false입니다. 기본값은 false입니다.

예제

다음 예제에서는 BindingGroup 설정 및 NotifyOnValidationErrortrue 애플리케이션에서 처리할 수 있도록 합니다 Validation.Error 이벤트 때를 ValidationRule 실패 합니다.

<StackPanel.BindingGroup>
  <BindingGroup NotifyOnValidationError="True">
    <BindingGroup.ValidationRules>
      <src:ValidateDateAndPrice ValidationStep="ConvertedProposedValue" />
    </BindingGroup.ValidationRules>
  </BindingGroup>
</StackPanel.BindingGroup>

다음 예제에서는 처리 된 Validation.Error 이벤트입니다.

// This event occurs when a ValidationRule in the BindingGroup
// or in a Binding fails.
private void ItemError(object sender, ValidationErrorEventArgs e)
{
    if (e.Action == ValidationErrorEventAction.Added)
    {
        MessageBox.Show(e.Error.ErrorContent.ToString());
    }
}
' This event occurs when a ValidationRule in the BindingGroup
' or in a Binding fails.
Private Sub ItemError(ByVal sender As Object, ByVal e As ValidationErrorEventArgs)
    If e.Action = ValidationErrorEventAction.Added Then
        MessageBox.Show(e.Error.ErrorContent.ToString())

    End If
End Sub

설명

합니다 Validation.Error 있는 요소에서 연결 된 이벤트가 발생 된 BindingGroup합니다.

적용 대상