private static void VisualizerViewClosed(object sender, EventArgs e)
 {
     if (_view != null)
     {
         _view.Closed -= VisualizerViewClosed;
         _view = null;
         _visualizerViewModel = null;
     }
 }
 private static void VisualizerViewClosed(object sender, EventArgs e)
 {
     if (_view != null)
     {
         _view.Closed        -= VisualizerViewClosed;
         _view                = null;
         _visualizerViewModel = null;
     }
 }
 public static void StartVisualizer(DisplayPreviewModuleDataModel dataModel)
 {
     if (_view != null)
     {
         _view.Focus();
     }
     else
     {
         _visualizerViewModel = new VisualizerViewModel(dataModel);
         _view = new VisualizerView { DataContext = _visualizerViewModel };
         _view.Closed += VisualizerViewClosed;
         _view.Show();
     }
 }
 public static void StartVisualizer(DisplayPreviewModuleDataModel dataModel)
 {
     if (_view != null)
     {
         _view.Focus();
     }
     else
     {
         _visualizerViewModel = new VisualizerViewModel(dataModel);
         _view = new VisualizerView {
             DataContext = _visualizerViewModel
         };
         _view.Closed += VisualizerViewClosed;
         _view.Show();
     }
 }