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(); } }; }
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(); } }; }