private void _OnLoaded(object sender, RoutedEventArgs e)
{
// removed loaded handler to prevent duplicate subscribing
Loaded -= _OnLoaded;
Assume that a dxdo:DocumentGroup contains two dxdo:DocumentPanel, and continue to assume that NLogViewer is placed under one of the dxdo:DocumentPanels. Switching to another dxdo:DocumentPanels will trigger _OnUnloaded of NLogViewer. Then switching back will cause _OnLoaded to no longer be triggered because of the above code Loaded -= _OnLoaded;, so the log will no longer be displayed.