BindingGroup.NotifyOnValidationError Property

Definition

Error의 상태가 변경될 때 ValidationRule 이벤트가 발생하는지 여부를 가져오거나 설정합니다.Gets or sets whether the Error event occurs when the state of a ValidationRule changes.

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

Property Value

Boolean

true의 상태가 변경될 때 Error 이벤트가 발생하면 ValidationRule이고, 그렇지 않으면 false입니다.true if the Error event occurs when the state of a ValidationRule changes; otherwise, false. 기본값은 false입니다.The default is false.

Examples

다음 예제에서는 BindingGroup 설정 및 NotifyOnValidationErrortrue 애플리케이션에서 처리할 수 있도록 합니다 Validation.Error 이벤트 때를 ValidationRule 실패 합니다.The following example creates a BindingGroup and sets NotifyOnValidationError to true so that the application can handle the Validation.Error event when a ValidationRule fails.

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

다음 예제에서는 처리 된 Validation.Error 이벤트입니다.The following example handles the Validation.Error event.

// 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

Remarks

합니다 Validation.Error 있는 요소에서 연결 된 이벤트가 발생 된 BindingGroup합니다.The Validation.Error attached event occurs on the element that has the BindingGroup.

Applies to