public void DoRemove(object obj)
 {
     if(obj is MotionControllerViewModel)
     {
         MotionControllerViewModel mcvw = (MotionControllerViewModel) obj;
         mcvw.Cleanup();
     }
     else if (obj is CameraViewModel)
     {
         CameraViewModel scvw = (CameraViewModel) obj;
         scvw.Cleanup();
     }
     else if(obj is ClientViewModel)
     {
         ClientViewModel cvw = (ClientViewModel) obj;
         cvw.Cleanup();
     }
 }
 void MotionControllerView_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     _viewModel = (MotionControllerViewModel) DataContext;
     CalibrationMagnetometerButton.Command = ShowMagnetometerCalibrationDialogCommand;
 }