/// <summary> /// Initializes a new instance of the ViewModelLocator class. /// </summary> public ViewModelLocator() { if (ViewModelBase.IsInDesignModeStatic) { _currentUserViewModel = new UserViewModel(); //_fishingMapViewModel = new FishingMapViewModel(); _mapViewModel = new MapViewModel(); } else { //_fishingMapViewModel = new FishingMapViewModel(); _mapViewModel = new MapViewModel(); _currentUserViewModel = new UserViewModel(); } }
/// <summary> /// Provides a deterministic way to create the CurrentUserViewModel property. /// </summary> public static void CreateCurrentUserViewModel() { if (_currentUserViewModel == null) { _currentUserViewModel = new UserViewModel(); } }
/// <summary> /// Provides a deterministic way to delete the CurrentUserViewModel property. /// </summary> public static void ClearCurrentUserViewModel() { _currentUserViewModel.Cleanup(); _currentUserViewModel = null; }