コード例 #1
0
        private void EditCommandHandler(object obj)
        {
            if (SelectedSearchFilterList == null)
            {
                return;
            }

            AddEditSearchFilterListDialog dialog = new AddEditSearchFilterListDialog(SelectedSearchFilterList.Id, SearchFilterLists.ToList());
            dialog.Show();

            dialog.Closed += (s1, e1) =>
            {
                if (dialog.DialogResult != null && dialog.DialogResult.Value)
                {
                    if (dialog.SearchFilterList == null) { return; }

                    //keep the same obj ref.
                    SelectedSearchFilterList.Name = dialog.SearchFilterList.Name;
                    SelectedSearchFilterList.Ordinal = dialog.SearchFilterList.Ordinal;
                    SelectedSearchFilterList.Description = dialog.SearchFilterList.Description;
                    SelectedSearchFilterList.IsDefault = dialog.SearchFilterList.IsDefault;

                    FixIsDefault();

                    RaisePropertyChanged("SelectedSearchFilterList");
                    RaisePropertyChanged("SearchFilterLists");

                    ShowErrorWhenNoDefult();

                }
            };
        }
コード例 #2
0
        private void AddCommandHandler(object parameter)
        {
            AddEditSearchFilterListDialog dialog = new AddEditSearchFilterListDialog(mTabId, SearchFilterLists.ToList());
            dialog.Show();

            dialog.Closed += (s1, e1) =>
            {
                if (dialog.DialogResult != null && dialog.DialogResult.Value)
                {
                    if (dialog.SearchFilterList == null)
                    {
                        return;
                    }

                    SearchFilterLists.Add(dialog.SearchFilterList);
                    SelectedSearchFilterList = dialog.SearchFilterList;

                    FixIsDefault();

                    RaisePropertyChanged("SearchFilterLists");
                    SelectedSearchFilterList = dialog.SearchFilterList;
                    RaisePropertyChanged("SelectedSearchFilterList");

                    ShowErrorWhenNoDefult();
                }
            };
        }