private void OnApplicationStateChanged(ApplicationState newApplicationState) { switch (newApplicationState) { case ApplicationState.LoggedIn: { MainViewModel = mainViewModelBuilder.Build(errorCallback, lastGridSize); IsMainViewVisible = true; IsLoginViewVisible = false; break; } default: { if (MainViewModel != null) { lastGridSize = mainViewModelBuilder.GetCurrentGridSize(); mainViewModelBuilder.DisposeViewModel(MainViewModel); MainViewModel = null; IsMainViewVisible = false; IsLoginViewVisible = true; } break; } } }
private void OnGridSizeChanged(Size newGridSize) { if (IsActive) { viewModelCommunication.SendTo( Constants.ViewModelCollections.TimeGridViewModelCollection, Identifier, new NewSizeAvailable(newGridSize) ); foreach (var therapyPlaceRowIdentifier in TherapyPlaceRowViewModels.Select(viewModel => viewModel.Identifier)) { viewModelCommunication.SendTo( Constants.ViewModelCollections.TherapyPlaceRowViewModelCollection, therapyPlaceRowIdentifier, new NewSizeAvailable(newGridSize) ); } } }
private void ReportSize(UIElement sender) { ReportedSize = (Size)sender.RenderSize; }