public FeaturesService(IServiceProvider services) { ServiceProvider = services; var allFeatureTypes = GetAllFeatures(); foreach (var featureType in allFeatureTypes) { IFeatureDefinition feature = null; if (ServiceProvider != null) { feature = ServiceProvider.GetService(featureType) as IFeatureDefinition; } if (feature == null) { feature = Activator.CreateInstance(featureType) as IFeatureDefinition; } Features.Add(feature); } }
public FeatureViewModel(IFeatureDefinition fd) { Feature = fd; }