/// <summary> /// Search the items by differents filter /// </summary> private void BtnSearchItems_Click(object sender, RoutedEventArgs e) { // Force the correction of the levels before searching the items TbxItemLvlSearch_LostFocus(TbxItemLvlMinSearch, e); TbxItemLvlSearch_LostFocus(TbxItemLvlMaxSearch, e); int minLvl = Convert.ToInt32(TbxItemLvlMinSearch.Text); int maxLvl = Convert.ToInt32(TbxItemLvlMaxSearch.Text); string nameItem = TbxNameSearch.Text.Trim(); int[] idRarities = GetIntArrayOfSelectedElements(MscbxRarity.GetListElements()); int[] idTypes = GetIntArrayOfSelectedElements(MscbxType.GetListElements()); int[] idStats = GetIntArrayOfSelectedElements(MscbxStats.GetListElements()); ItemsDataGrid.ItemsSource = EncycloDB.SearchItems(minLvl, maxLvl, nameItem, idRarities, idTypes, idStats); ActualSortedColumnIndex = 0; // Reset the sort if (ItemsDataGrid.Items.Count > 0) { ItemsDataGrid.ScrollIntoView(ItemsDataGrid.Items[0]); } CloseAllPopup(); }
// Close the pop up of the multiselectcombobox private void CloseAllPopup() { MscbxRarity.ClosePopUp(); MscbxStats.ClosePopUp(); MscbxType.ClosePopUp(); }