BindingGroup.NotifyOnValidationError Eigenschaft

Definition

Ruft ab oder legt fest, ob bei Änderungen am Zustand einer Error das ValidationRule-Ereignis eintritt.

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

Eigenschaftswert

Boolean

true, wenn bei Änderungen am Zustand einer Error das ValidationRule-Ereignis eintritt, andernfalls false. Der Standardwert ist false.

Beispiele

Im folgenden Beispiel wird eine BindingGroup Und-Sätze true NotifyOnValidationError erstellt, damit die Anwendung das Validation.Error Ereignis behandeln kann, wenn ein ValidationRule Fehler auftritt.

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

Im folgenden Beispiel wird das Validation.Error Ereignis behandelt.

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

Hinweise

Das Validation.Error angefügte Ereignis tritt auf dem Element auf, das die BindingGroup.

Gilt für: