private void EmptySuperSessionOrReplaceSession_Drop(object sender, DragEventArgs e)
 {
     if (e.Data.GetDataPresent("snapshotDragItem"))
     {
         Border item = sender as Border;
         ViewModelImagingSessionBase  substituteImagingSession = item.DataContext as ViewModelImagingSessionBase;
         ViewModelImagingSuperSession ss        = substituteImagingSession.Parent as ViewModelImagingSuperSession;
         ViewModelImagingSuperSession genericVM = (ViewModelImagingSuperSession)e.Data.GetData("snapshotDragItem");
         if (ss.VisualizationAndAnalysisType == Xvue.MSOT.DataModels.Plugins.ProjectManager.VisualizationAndAnalysis.Visualization)
         {
             ss.MSOTService.UIStaticDispatcher.BeginInvoke(new Action(() =>
             {
                 ss.ReplaceNewImagingSessionCopyThread(substituteImagingSession, genericVM.ImagingSessions[0], true);
             }));
         }
         else
         {
             if (ss.VerifySavingOfDataModelChanges(true))
             {
                 ss.MSOTService.UIStaticDispatcher.BeginInvoke(new Action(() =>
                 {
                     ViewModelStudyNode study = ss.Parent as ViewModelStudyNode;
                     if (study != null)
                     {
                         study.SelectedSuperSession = genericVM;
                         study.LoadSelectedSuperSession();
                     }
                 }));
             }
         }
         item.SetCurrentValue(BorderBrushProperty, new SolidColorBrush(Colors.White));
         e.Handled = true;
     }
 }
        private void AddReplaceSession_Drop(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent("snapshotDragItem"))
            {
                ViewImagingSessionGeneric    item = sender as ViewImagingSessionGeneric;
                ViewModelImagingSessionBase  substituteImagingSession = item.DataContext as ViewModelImagingSessionBase;
                ViewModelImagingSuperSession ss = substituteImagingSession.Parent as ViewModelImagingSuperSession;

                ViewModelImagingSuperSession genericVM = (ViewModelImagingSuperSession)e.Data.GetData("snapshotDragItem");

                ss.MSOTService.UIStaticDispatcher.BeginInvoke(new Action(() =>
                {
                    ss.ReplaceNewImagingSessionCopyThread(substituteImagingSession, genericVM.ImagingSessions[0], true);
                }));

                item.SessionBorder.SetCurrentValue(BorderBrushProperty, new SolidColorBrush(Colors.White));
                e.Handled = true;
            }
        }