public static bool TryGetDependencyType <TDependency>(this ComponentModel model, out Type dependencyType) { var dependency = model.GetDependencyFor(typeof(TDependency)); if (dependency == null) { dependencyType = null; return(false); } dependencyType = dependency.TargetItemType; return(true); }