public ViewFactory( IViewDescriptorCollection viewDescriptors, IViewInvoker viewInvoker) { _viewDescriptors = viewDescriptors; _viewInvoker = viewInvoker; }
public static T FirstDescriptorModelOfType <T>(this IViewDescriptorCollection viewDescriptorCollection) where T : class { if (viewDescriptorCollection.Descriptors.ContainsKey(typeof(T))) { if (viewDescriptorCollection.Descriptors[typeof(T)][0].View.Model is T) { return((T)viewDescriptorCollection.Descriptors[typeof(T)][0].View.Model); } } return(null); }