private void Window_Loaded(object sender, RoutedEventArgs e) { if (Requirement != null) { if (Requirement.Type == "SW") { uxSW.IsChecked = true; } else { uxHW.IsChecked = true; } if (Requirement.Status == "Open") { uxOpen.IsChecked = true; } else { uxClosed.IsChecked = true; } uxSubmit.Content = "Modify"; } else { Requirement = new UIRequirementModel(); } uxGrid.DataContext = Requirement; }
private void OnUpdateRequirement(UIRequirementModel selectedRequirement) { var window = new RequirementWindow(); window.Requirement = selectedRequirement; if (window.ShowDialog() == true) { var uiRequirement = window.Requirement; var repositoryRequirementModel = uiRequirement.ToRepositoryModel(); App.RequirementRepository.Update(repositoryRequirementModel); } }
private bool CanDeleteRequirement(UIRequirementModel arg) { return(uxDataGrid.SelectedItem != null); }
private void OnDeleteRequirement(UIRequirementModel uIRequirementModel) { App.RequirementRepository.Delete(uIRequirementModel.Id); LoadRequirements(); }
//Get Requirements private void LoadRequirements() { var requirements = App.RequirementRepository.GetAll(); Requirements = new ObservableCollection <UIRequirementModel>(requirements.Select(x => UIRequirementModel.ToModel(x))); }