PresentationSource.RootChanged(Visual, Visual) PresentationSource.RootChanged(Visual, Visual) PresentationSource.RootChanged(Visual, Visual) 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);
member this.RootChanged : System.Windows.Media.Visual * System.Windows.Media.Visual -> unit
Protected Sub RootChanged (oldRoot As Visual, newRoot As Visual)

Parameters

oldRoot
Visual Visual Visual Visual

The old root Visual.

newRoot
Visual Visual Visual Visual

The new root Visual.

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