private void button_search_Click(object sender, RoutedEventArgs e) { Marketplace mkt = new Marketplace(); if (radioButton_byTitle.IsChecked == true) { mkt.SearchByBookTitle(textBox_search.Text); //Is search by Book Title } if (radioButton_byAuthor.IsChecked == true) { mkt.SearchByAuthor(textBox_search.Text); //If search by author } if (radioButton_byCourse.IsChecked == true) { string[] strArray = textBox_search.Text.Split(); mkt.SearchByCourse(strArray[0].Trim(), strArray[1].Trim()); //If search by course } if (radioButton_byISBN.IsChecked == true) { mkt.SearchByISBN(textBox_search.Text); //if search by isbn } resultsListBox.ItemsSource = mkt.listings; //data binding }