private async void OnEventAfterDetailSavedAsync(EventAfterDetailSavedArgs eventAfterDetailSavedArgs) { await ClassifyDetailViewModel(eventAfterDetailSavedArgs.ViewModelName, async() => { LookupItemsAccountManager = await ObservableCollectionWithNullLookupItemAndLookupItems( async() => await _lookupDataServiceAccountManager.GetEntityLookupAsync()); }); }
/// <summary> /// Creates a list of NavigationItemViewModel representing the Entities to navigate through. /// </summary> /// <returns>True, when craetion was succesfull</returns> /// <remarks> /// The list of items are created by using the constructor parameter entityLookupDataService. /// The function entityLookupDataService.GetEntityLookupAsync() returns a list of TEntity. /// From TEntity.Id (unique identifier of a TEntity), /// TEntity.DisplayMember (string representing the display member of TEntity in the UI), /// NameOfDetailViewModel() (Name of the DetailViewModel in which TEntity will be displyed in the UI) /// and the constructor EventAggregator parameter /// a list of items of type NavigationItemViewModel will be created. /// </remarks> protected async Task <bool> LoadAsyncBase() { //TODO Write unit test //TODO Write integration test var lookupItems = await _entityLookupDataService.GetEntityLookupAsync(); EntityNavigationItemViewModels.Clear(); foreach (var lookupItem in lookupItems) { EntityNavigationItemViewModels.Add( new NavigationItemViewModel ( lookupItem.Id, lookupItem.DisplayMember, NameOfDetailViewModel(), EventAggregator) ); } return(true); }