예제 #1
0
        private void AddMembershipLinkTypeCommandExecuted()
        {
            RaisePropertyChanged("DisableParentWindow");

            var addMembershipLinkTypeView = new AddMembershipLinkTypeView(MembershipLinkType);

            addMembershipLinkTypeView.ShowDialog();

            RaisePropertyChanged("EnableParentWindow");
            if (addMembershipLinkTypeView.DialogResult != null && addMembershipLinkTypeView.DialogResult == true)
            {
                if (Content != null)
                {
                    var viewModel = Content.DataContext as MembershipLinkTypesViewModel;
                    if (viewModel != null)
                    {
                        viewModel.AllMembershipLinkTypes.Add(addMembershipLinkTypeView.ViewModel.MembershipLinkType);
                        viewModel.RefreshMembershipLinkTypes();
                        viewModel.SelectedMembershipLinkType = addMembershipLinkTypeView.ViewModel.MembershipLinkType;
                    }
                }

                TreeViewItemPath = "Members|Link Types";

                RaisePropertyChanged("SelectTreeViewItem");
            }
        }
예제 #2
0
        private void EditMembershipLinkTypeCommandExecuted(MembershipLinkTypeModel membershipLinkType)
        {
            RaisePropertyChanged("DisableParentWindow");

            var view = new AddMembershipLinkTypeView(membershipLinkType);

            view.ShowDialog();

            RaisePropertyChanged("EnableParentWindow");

            if (view.DialogResult != null && view.DialogResult == true)
            {
                _adminDataUnit.MembershipLinkTypesRepository.Refresh();
                RefreshMembershipLinkTypes();
                SelectedMembershipLinkType = membershipLinkType;
            }
        }