DataPagerField.OnFieldChanged 方法


引發 FieldChanged 事件。Raises the FieldChanged event.

 virtual void OnFieldChanged();
protected virtual void OnFieldChanged ();
abstract member OnFieldChanged : unit -> unit
override this.OnFieldChanged : unit -> unit
Protected Overridable Sub OnFieldChanged ()


方法會引發事件, 指出DataPagerField物件的狀態已變更。 OnFieldChangedThe OnFieldChanged method raises an event that indicates that the state of the DataPagerField object has changed. 對屬性所Visible做的變更會導致引發此事件。Changes to the Visible property cause this event to be raised. 變更衍生類型中的屬性時, 也會在發生狀態變更時引發此事件。Changes to properties in derived types also raise this event when state changes occur.

OnFieldChanged方法可讓衍生類別處理事件, 而不需要附加委派。The OnFieldChanged method enables derived classes to handle the event without attaching a delegate. 這是在衍生類別中處理事件的慣用技巧。This is the preferred technique for handling the event in a derived class.


當您在OnFieldChanged()衍生類別中覆寫時, 呼叫基類的OnFieldChanged()方法, 讓已註冊的委派能接收事件。When you override OnFieldChanged() in a derived class, call the base class's OnFieldChanged() method so that registered delegates receive the event.