NotifyDataErrorValidationRule 類別

定義

表示規則,此規則會檢查實作 INotifyDataErrorInfo 之資料來源所引發的錯誤。Represents a rule that checks for errors that are raised by a data source that implements INotifyDataErrorInfo.

public ref class NotifyDataErrorValidationRule sealed : System::Windows::Controls::ValidationRule
public sealed class NotifyDataErrorValidationRule : System.Windows.Controls.ValidationRule
type NotifyDataErrorValidationRule = class
    inherit ValidationRule
Public NotInheritable Class NotifyDataErrorValidationRule
Inherits ValidationRule
繼承
NotifyDataErrorValidationRule

備註

資料系結模型可讓您與ValidationRules BindingBindingGroup物件產生關聯。 WPFWPFThe WPFWPF data binding model enables you to associate ValidationRules with a Binding or BindingGroup object. NotifyDataErrorValidationRule類別是一個內建規則, 它會檢查系結來源屬性更新期間所擲回的例外狀況。The NotifyDataErrorValidationRule class is a built-in rule that checks for exceptions that are thrown during the updates of the binding source property. 您可以提供自訂邏輯, 以指定系結引擎如何使用UpdateSourceExceptionFilterCallback來處理這些例外狀況。You can provide custom logic to specify how the binding engine handles these exceptions by using a UpdateSourceExceptionFilterCallback. 如需詳細資訊,請參閱UpdateSourceExceptionFilterFor more information, see UpdateSourceExceptionFilter.

明確設定NotifyDataErrorValidationRule的替代語法是在您BindingGroup true ValidatesOnExceptions Binding的、或物件上, MultiBinding將屬性設定為。An alternative syntax to setting the NotifyDataErrorValidationRule explicitly is to set the ValidatesOnExceptions property to true on your Binding, MultiBinding, or BindingGroup object. 根據預設, 的值ValidatesOnExceptionstrue, 因此您不NotifyDataErrorValidationRule需要明確地使用。By default, the value of ValidatesOnExceptions is true, so you do not need to explicitly use a NotifyDataErrorValidationRule.

您可以藉由建立衍生ValidationRule自的類別來建立自訂規則。You can create a custom rule by creating a class that derives from ValidationRule. 如需資料驗證的詳細資訊和詳細討論, 請參閱資料系結總覽For more information and a detailed discussion of data validation, see Data Binding Overview.

建構函式

NotifyDataErrorValidationRule()

建立 NotifyDataErrorValidationRule 類別的新執行個體。Creates a new instance of the NotifyDataErrorValidationRule class.

屬性

ValidatesOnTargetUpdated

取得或設定值,這個值表示是否在 Binding 的目標更新值執行驗證規則。Gets or sets a value that indicates whether the validation rule runs when the target of the Binding is updated.

(繼承來源 ValidationRule)
ValidationStep

取得或設定執行驗證規則的時機。Gets or sets when the validation rule runs.

(繼承來源 ValidationRule)

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

作為預設雜湊函數。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)
Validate(Object, CultureInfo)

在值上執行驗證檢查。Performs validation checks on a value.

Validate(Object, CultureInfo, BindingExpressionBase)

在值上執行驗證檢查。Performs validation checks on a value.

(繼承來源 ValidationRule)
Validate(Object, CultureInfo, BindingGroup)

在值上執行驗證檢查。Performs validation checks on a value.

(繼承來源 ValidationRule)

適用於