Muokkaa

Jaa


PresentationSource.RootChanged(Visual, Visual) Method

Definition

Provides notification that the root Visual has changed.

protected:
 void RootChanged(System::Windows::Media::Visual ^ oldRoot, System::Windows::Media::Visual ^ newRoot);
[System.Security.SecurityCritical]
[System.Security.SecurityTreatAsSafe]
protected void RootChanged (System.Windows.Media.Visual oldRoot, System.Windows.Media.Visual newRoot);
protected void RootChanged (System.Windows.Media.Visual oldRoot, System.Windows.Media.Visual newRoot);
[<System.Security.SecurityCritical>]
[<System.Security.SecurityTreatAsSafe>]
member this.RootChanged : System.Windows.Media.Visual * System.Windows.Media.Visual -> unit
member this.RootChanged : System.Windows.Media.Visual * System.Windows.Media.Visual -> unit
Protected Sub RootChanged (oldRoot As Visual, newRoot As Visual)

Parameters

oldRoot
Visual

The old root Visual.

newRoot
Visual

The new root Visual.

Attributes

Remarks

Derived classes should call this method to indicate that their root Visual has changed.

Calling this method causes two object lifetime events to be raised on the specified root visuals, if and only if those root visuals are FrameworkElement derived classes.

  • The old root visual will raise the Unloaded event, and will process its tree of elements downward, broadcasting this event to each child element.

  • The new root visual will raise the Loaded event, and will process its tree of elements downward, broadcasting this event to each child element.

Applies to