private void SessionGeneric_DragLeave(object sender, DragEventArgs e)
 {
     try
     {
         ViewImagingSessionGeneric control = sender as ViewImagingSessionGeneric;
         control.SessionBorder.SetCurrentValue(BorderBrushProperty, new SolidColorBrush(Colors.White));
     }
     catch { }
 }
 private void SessionGeneric_DragEnter(object sender, DragEventArgs e)
 {
     try
     {
         if (e.Data.GetDataPresent("snapshotDragItem"))
         {
             ViewImagingSessionGeneric control = sender as ViewImagingSessionGeneric;
             control.SessionBorder.SetCurrentValue(BorderBrushProperty, new SolidColorBrush(Colors.Cyan));
         }
     }
     catch { }
 }
        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;
            }
        }