private void SearchServices_Click(object sender, RoutedEventArgs e) { getAllServices = null; //get entered query String query = searchQueryTextBox.Text; //get reponse provided by the RegistryAccessClass.searchServices getAllServices = RegistryAccessClass.searchServices(query, TOKEN); //assign to the data grid allServicesDataGrid.DataContext = getAllServices.Services; }
private void ViewAllServices_Click(object sender, RoutedEventArgs e) { //initalizing list getAllServices = null; DataTable allServices = new DataTable(); //geting reponse for all services getAllServices = RegistryAccessClass.getAllServices(TOKEN); if (getAllServices != null) { //assigning to data grid allServicesDataGrid.DataContext = getAllServices.Services; } else { MessageBox.Show("Error! Unable to fetch all services!"); } }