private WrappingCollection.WithSelection CreateWarehouseItems() { var wc = new WrappingCollection.WithSelection { FactoryMethod = o => _viewModelCreatorService.CreateViewModel<IWarehouseItem, WarehouseItemViewModel>((IWarehouseItem) o) }.WithSource(_dataService.WarehouseItems); return wc; }
private WrappingCollection.WithSelection CreateWarehouseItems() { var wc = new WrappingCollection.WithSelection { FactoryMethod = o => _viewModelCreatorService.CreateViewModel <IWarehouseItem, WarehouseItemViewModel>( (IWarehouseItem)o) }.WithSource(_dataService.WarehouseItems); return(wc); }
private WrappingCollection.WithSelection CreateItems() { WrappingCollection.WithSelection wc = null; // ReSharper disable once AccessToModifiedClosure wc = new WrappingCollection.WithSelection(o => wc?.SelectedItem == null) { FactoryMethod = o => _viewModelCreatorService.CreateViewModel <ISampleItem, SampleItemViewModel>((ISampleItem)o) }.WithSource(_dataService.Items); return(wc); }