AutomationPeer.InvalidatePeer 方法

定義

觸發重新計算 AutomationPeer 的主要屬性,並在屬性變更時引發對自動化用戶端的 PropertyChanged 通知。Triggers recalculation of the main properties of the AutomationPeer and raises the PropertyChanged notification to the Automation Client if the properties changed.

public:
 void InvalidatePeer();
public void InvalidatePeer ();
member this.InvalidatePeer : unit -> unit
Public Sub InvalidatePeer ()

備註

主要屬性的範例包括(但不限於) LogicalChildrenBoundingRectangleExamples of main properties include, but are not limited to, LogicalChildren and BoundingRectangle.

一般來說,更新和通知會在 Windows Presentation Foundation (WPF) 中的版面配置更新之後自動發生。Typically, updates and notifications happen automatically after the update of the layout in Windows Presentation Foundation (WPF). (進行更新時,就會發生此 LayoutUpdated 事件。 ) 有時屬性會變更,而不會引發 LayoutUpdated 事件。(The update occurs in response to the LayoutUpdated event.) Sometimes, however, properties change without raising the LayoutUpdated event. 例如,當整個移動時 WindowLayoutUpdated 不會引發事件。For example, when the whole Window moves, the LayoutUpdated event is not raised. 在此範例中,物件集合 BoundingRectangle 會變更,因為物件是以螢幕座標表示。In this example, the set of BoundingRectangle objects change because the objects are expressed in screen coordinates. 因此, Window 必須在 InvalidatePeer 其對等上呼叫 WindowAutomationPeerTherefore, the Window must call InvalidatePeer on its peer on WindowAutomationPeer.

適用於