Light. On Disconnected(UIElement) Method
This method is automatically called when the XamlLight is no longer in use anywhere on the screen.
This provides an opportunity to safely dispose of resources such as the CompositionLight when they aren't currently required.
OnConnected will be called again if the XamlLight is later used to light any UIElements or Brushes after being disconnected.
protected: virtual void OnDisconnected(UIElement ^ oldElement) = OnDisconnected;
void OnDisconnected(UIElement const & oldElement);
protected virtual void OnDisconnected(UIElement oldElement);
Protected Overridable Sub OnDisconnected (oldElement As UIElement)