private void AddMembershipCategoryCommandExecuted() { RaisePropertyChanged("DisableParentWindow"); var addMembershipCategoryView = new AddMembershipCategoryView(MembershipCategory); addMembershipCategoryView.ShowDialog(); RaisePropertyChanged("EnableParentWindow"); if (addMembershipCategoryView.DialogResult != null && addMembershipCategoryView.DialogResult == true) { if (Content != null) { var viewModel = Content.DataContext as MembershipCategoriesViewModel; if (viewModel != null) { viewModel.AllMembershipCategories.Add(addMembershipCategoryView.ViewModel.MembershipCategory); viewModel.RefreshMembershipCategories(); viewModel.SelectedMembershipCategory = addMembershipCategoryView.ViewModel.MembershipCategory; } } TreeViewItemPath = "Members|Categories"; RaisePropertyChanged("SelectTreeViewItem"); } }
private void EditMembershipCategoryCommandExecuted(MembershipCategoryModel membershipCategory) { RaisePropertyChanged("DisableParentWindow"); var view = new AddMembershipCategoryView(membershipCategory); view.ShowDialog(); RaisePropertyChanged("EnableParentWindow"); if (view.DialogResult != null && view.DialogResult == true) { _membershipDataUnit.MembershipCategoriesRepository.Refresh(); _adminDataUnit.MembershipCategoriesRepository.RefreshCategoryGroupsWithItsTabs(); RefreshMembershipCategories(); SelectedMembershipCategory = membershipCategory; } }