Once a category is selected we hit the button and the name of the category "goes into" this variable called "selected". Now, how to put inside of ElementCategoryFilter that variable containing the necessary category? selected category
public void Button_Click(object sender, RoutedEventArgs e)
{
string selected = AllTheCategories.SelectedItem.ToString();
}
ElementCategoryFilter filter = new ElementCategoryFilter();
You can directly assign selected string to your ElementCategoryFilter inside your Button_Click event.