private void PopulateListOfItemGroups(DisplayItemGroups List, string searchString) { List.Clear(); List <ItemGroup> searchResults = _db.TableItemGroup.SearchItemGroups(searchString); foreach (ItemGroup searchResult in searchResults) { List.Add(searchResult); } }
public ItemGroupViewModel(IDatabaseService db, IMessageBox mb) { var dummyBool = true; CreateItemGroupCommand = new RelayCommand(createItemGroupHandler, () => dummyBool == true); DeleteItemGroupCommand = new RelayCommand(deleteItemGroupHandler, () => ListOfItemGroups.CurrentIndex >= 0); EditItemGroupCommand = new RelayCommand(editItemGroupHandler, () => ItemGroupName != ""); SearchCommand = new RelayCommand(searchItemGroupHandler, () => dummyBool == true); _db = db; _messageBox = mb; ListOfItemGroups = new DisplayItemGroups(); ComboBoxOptions = new DisplayItemGroups(); PopulateListOfItemGroups(ListOfItemGroups, ""); PopulateListOfItemGroups(ComboBoxOptions, ""); ComboBoxIndex = -1; ItemGroupName = ""; SearchString = ""; }