Esempio n. 1
0
        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;
            }
            }
        }
Esempio n. 2
0
        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;
 }