PresentationSource::RootChanged Method (Visual^, Visual^)

 

Provides notification that the root Visual has changed.

Namespace:   System.Windows
Assembly:  PresentationCore (in PresentationCore.dll)

protected:
[SecurityTreatAsSafeAttribute]
[SecurityCriticalAttribute]
void RootChanged(
	Visual^ oldRoot,
	Visual^ newRoot
)

Parameters

oldRoot
Type: System.Windows.Media::Visual^

The old root Visual.

newRoot
Type: System.Windows.Media::Visual^

The new root Visual.

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.

.NET Framework
Available since 3.0
Return to top
Show: