public void LoadCategories() { _filteredCategoriesList = Controller.SearchCategories(SearchCategoryTextBox.Text); CategoriesStack.Children.Clear(); foreach (var p in _filteredCategoriesList) { var t = new Button { Content = p.Name }; t.Click += (s, e) => { var с = new CategoryWindow(this, p.Name); с.Show(); this.Hide(); }; CategoriesStack.Children.Add(t); } }
private void NewCategoryButton_Click(object sender, RoutedEventArgs e) { var p = new CategoryWindow(this, ""); p.Show(); this.Hide(); }