/// <summary> /// Shutdown the view model. /// </summary> /// <param name="close"></param> void IDeactivate.Deactivate(bool close) { // Shutdown the pulse manager PulseManager pm = IoC.Get <PulseManager>(); if (pm != null) { pm.Dispose(); } // Shutdown the singleton HomeViewModels HomeViewModel homeVM = IoC.Get <HomeViewModel>(); if (homeVM != null) { homeVM.Dispose(); } // Shutdown the singleton ViewDataBaseViewModel ViewDataBaseViewModel viewDataVM = IoC.Get <ViewDataBaseViewModel>(); if (viewDataVM != null) { viewDataVM.Dispose(); } // Shutdown the singleton PlaybackViewModel PlaybackViewModel playbackVM = IoC.Get <PlaybackViewModel>(); if (playbackVM != null) { playbackVM.Dispose(); } // Shutdown the singleton ValidationTestViewModel ValidationTestViewModel vtVM = IoC.Get <ValidationTestViewModel>(); if (vtVM != null) { vtVM.Dispose(); } // Shutdown the singleton CompassCalViewModel CompassCalViewModel ccVM = IoC.Get <CompassCalViewModel>(); if (ccVM != null) { ccVM.Dispose(); } // Shutdown the singleton ViewDataBaseGraphicalViewModel ViewDataBaseGraphicalViewModel vdGraph = IoC.Get <ViewDataBaseGraphicalViewModel>(); if (vdGraph != null) { vdGraph.Dispose(); } // Shutdown the singleton ViewDataBaseTextViewModel ViewDataBaseTextViewModel vdText = IoC.Get <ViewDataBaseTextViewModel>(); if (vdText != null) { vdText.Dispose(); } // Shutdown the singleton ScreenDataBaseViewModel ScreenDataBaseViewModel sdVM = IoC.Get <ScreenDataBaseViewModel>(); if (sdVM != null) { sdVM.Dispose(); } // Shutdown the singleton AveragingBaseViewModel AveragingBaseViewModel abVM = IoC.Get <AveragingBaseViewModel>(); if (abVM != null) { abVM.Dispose(); } // Shutdown the singleton ValidationTestBaseViewModel ValidationTestBaseViewModel vtbVM = IoC.Get <ValidationTestBaseViewModel>(); if (vtbVM != null) { vtbVM.Dispose(); } // Shutdown the singleton DownloadDataViewModel DownloadDataViewModel ddVM = IoC.Get <DownloadDataViewModel>(); if (ddVM != null) { ddVM.Dispose(); } // Shutdown the singleton UpdateFirmwareViewModel UpdateFirmwareViewModel ufVM = IoC.Get <UpdateFirmwareViewModel>(); if (ufVM != null) { ufVM.Dispose(); } // Shutdown the singleton CompassUtilityViewModel CompassUtilityViewModel cuVM = IoC.Get <CompassUtilityViewModel>(); if (cuVM != null) { cuVM.Dispose(); } // Shutdown the singleton RtiCompassCalViewModel RtiCompassCalViewModel rtiCcVM = IoC.Get <RtiCompassCalViewModel>(); if (rtiCcVM != null) { rtiCcVM.Dispose(); } //// Shutdown the singleton TerminalViewModel //TerminalViewModel termVM = IoC.Get<TerminalViewModel>(); //if (termVM != null) //{ // termVM.Dispose(); //} //// Shutdown the singleton TerminalAdcpViewModel //TerminalAdcpViewModel tadcpVM = IoC.Get<TerminalAdcpViewModel>(); //if (tadcpVM != null) //{ // tadcpVM.Dispose(); //} //// Shutdown the singleton TerminalNavViewModel //TerminalNavViewModel tnavVM = IoC.Get<TerminalNavViewModel>(); //if (tnavVM != null) //{ // tnavVM.Dispose(); //} // Shutdown the singleton AboutViewModel AboutViewModel aboutVM = IoC.Get <AboutViewModel>(); if (aboutVM != null) { aboutVM.Dispose(); } // Shutdown the singleton VesselMountViewModel VesselMountViewModel vmVM = IoC.Get <VesselMountViewModel>(); if (vmVM != null) { vmVM.Dispose(); } // Shutdown the singleton VesselMountViewModel DataOutputViewModel vmDO = IoC.Get <DataOutputViewModel>(); if (vmDO != null) { vmDO.Dispose(); } // Shutdown the singleton VesselMountViewModel WpMagDirOutputViewModel vmWMD = IoC.Get <WpMagDirOutputViewModel>(); if (vmWMD != null) { vmWMD.Dispose(); } // Shutdown the last active item DeactivateItem(ActiveItem, true); // MAKE THIS THE LAST THING TO SHUTDOWN // Shutdown the ADCP connection AdcpConnection adcp = IoC.Get <AdcpConnection>(); if (adcp != null) { adcp.Dispose(); } // Shutdown the applicaton and all the threads Environment.Exit(Environment.ExitCode); }