public static ResourceDictionary CreateDynamicDataTemplates([NotNull] ExportProvider exportProvider) { var dataTemplateResources = new ResourceDictionary(); var exportMetaData = exportProvider.GetDataTemplateExportsMetadata(); foreach (var item in exportMetaData) { var viewModel = item.ViewModel; var role = item.Role; var template = CreateTemplate(viewModel, role); dataTemplateResources.Add(CreateKey(viewModel, role), template); } return(dataTemplateResources); }
public static ResourceDictionary CreateDynamicDataTemplates([NotNull] ExportProvider exportProvider) { Contract.Requires(exportProvider != null); Contract.Ensures(Contract.Result <ResourceDictionary>() != null); var dataTemplateResources = new ResourceDictionary(); var exportMetaData = exportProvider.GetDataTemplateExportsMetadata(); foreach (var item in exportMetaData) { Contract.Assume(item != null); var viewModel = item.ViewModel; var role = item.Role; var template = CreateTemplate(viewModel, role); dataTemplateResources.Add(CreateKey(viewModel, role), template); } return(dataTemplateResources); }