private void LoadData() { _appService.GetData(); isLoaded = true; LoadDataCommand.RaiseCanExecuteChanged(); StartSimulationCommand.RaiseCanExecuteChanged(); }
/// <summary> /// The OnMazePropertyChanged method is called when a property in the Maze model class changes. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnMazePropertyChanged(object sender, PropertyChangedEventArgs e) { try { GenerateMazeCommand.RaiseCanExecuteChanged(); ResetMazeCommand.RaiseCanExecuteChanged(); StartSimulationCommand.RaiseCanExecuteChanged(); StopSimulationCommand.RaiseCanExecuteChanged(); } catch (Exception ex) { throw new Exception("MazeGeneratorViewModel.OnMazePropertyChanged(object sender, PropertyChangedEventArgs e): " + ex.ToString()); } }
/// <summary> /// The OnForestPropertyChanged method is called when a property in the Forest model class changes. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnForestPropertyChanged(object sender, PropertyChangedEventArgs e) { try { StartSimulationCommand.RaiseCanExecuteChanged(); StopSimulationCommand.RaiseCanExecuteChanged(); StepSimulationCommand.RaiseCanExecuteChanged(); ResetSimulationCommand.RaiseCanExecuteChanged(); StartFireCommand.RaiseCanExecuteChanged(); } catch (Exception ex) { throw new Exception("ForestFireSimulatorViewModel.OnForestPropertyChanged(object sender, PropertyChangedEventArgs e): " + ex.ToString()); } }
private void StartSimulation() { _appService.StartSimulator(); isStarted = true; StartSimulationCommand.RaiseCanExecuteChanged(); }