private void CloseSubPanels() { gridAddPanelPlace.Children.Clear(); gridAddPanelPlace.Visibility = Visibility.Hidden; AddPanelView = null; isPanelViewVisible = false; UpdateListView(); }
private void BtnAddContent_Click(object sender, RoutedEventArgs e) { if (isPanelViewVisible || IsReadOnlyMode) { return; } AddPanelView = new RecipePanel(); AddPanelView.addToListOfContentsEvent += AddToListRecipe; AddPanelView.closeEvent += CloseSubPanels; AddPanelView.addNewContentToDatabaseEvent += IO.Database.AddContentToDatabase; this.gridAddPanelPlace.Visibility = Visibility.Visible; this.gridAddPanelPlace.Children.Add(AddPanelView); isPanelViewVisible = true; }