//Searches the Librari for Items by numerous parameters //and display the results in the DataGrid private void MultipleSearch() { //Base Category parameter (nullable) //the default value is true for using it in predicate //if User haven't choose the Base Category eBaseCategory?eBase = cmbBaseCategory.SelectedValue is eBaseCategory ? (eBaseCategory?)cmbBaseCategory.SelectedValue : null; //Inner Category parameter (nullable) //the default value is true for using it in predicate //if User haven't choose the Inner Category eInnerCategory?eInner = cmbInnerCategory.SelectedValue is eInnerCategory ? (eInnerCategory?)cmbInnerCategory.SelectedValue : null; //Make Multiply Search by numerous parameters //and display the results in the DataGrid dataLib.ItemsSource = mainLibrary.MultiSearch(eBase, eInner, txtName.Text); }