private void LoadDocumentTypes() { var documentTypeDtos = GetDocumentTypesQuery.List(); documentTypeDtos.Insert(0, new DocumentTypeDto()); DocumentTypeDropdown.ItemsSource = documentTypeDtos; DocumentTypeDropdown.DisplayMemberPath = nameof(DocumentTypeDto.Name); DocumentTypeDropdown.SelectedValuePath = nameof(DocumentTypeDto.Id); }
public DocumentTypeAdminViewModel() //: base(GetDocumentTypesQuery.List().Select(x => new AdminItem { Id = x.Id, Name = x.Name }).ToList()) { var documentTypes = GetDocumentTypesQuery.List() .Select(x => new AdminItem { Id = x.Id, Name = x.Name }).ToList(); Items = new ObservableCollection <AdminItem>(documentTypes); //OriginalItems = documentTypes; }
private void LoadDocumentTypes() { documentTypeDropdownItemsSource = new ObservableCollection <DocumentTypeDto>(GetDocumentTypesQuery.List()); DocumentTypeDropdown.ItemsSource = documentTypeDropdownItemsSource; DocumentTypeDropdown.DisplayMemberPath = nameof(DocumentTypeDto.Name); DocumentTypeDropdown.SelectedValuePath = nameof(DocumentTypeDto.Id); }