// TODO: test protected override void SelectionChanged(Dal.IUiBase item) { if (item is UiProject) { // master base.SelectionChanged(item); (view as IDetailCustomView).GridDetailSource = item == null ? null : detailService.GetList(item); } else { // detail if (item == null) { return; } if (item is UiProjectItemsCategory) { CategoryUpdate(item as UiProjectItemsCategory); } else if (item.IsDirty) { item.Update(); } } }
public void SetChildFilter(IUiBase parent) { this.searchValue = string.Empty; this.parent = parent; HasParent = parent != null; var dataSource = service.GetList(GetListParent()); RefreshService(dataSource); }
private void SelectService(IDataClientService newService, Type dataType, UiBase parent, IEnumerable <string> reports = null) { // reset filter this.SearchValue = string.Empty; service = newService; service.UpdateStatus += service_UpdateStatus; //view.SetDetail(dataType);/* no need : detail items bound directly to grid's selection */ dataSource = service.GetList(GetListParent()); RefreshService(dataSource); RaisePropertyChanged("ForwardLinks"); HasParent = parent != null; // TODO //if (reports != null) // view.SetReports(reports); // TODO : remove temporary hack if (dataType == typeof(UiEmployee)) { (dataSource as ObservableCollection <UiEmployee>)[1].IsLocked = true; } }
private void RefreshData() { SetDataSource(service.GetList(GetListParent(), SearchValue)); }