// $$$ Move to better place. From internal static void ValidateContractCompatibility <TPath>(this IBindablePath <TPath> path, IReadOnlyDictionary <string, Type> bindingDataContract) { if (path == null) { throw new ArgumentNullException("path"); } BindingTemplateExtensions.ValidateContractCompatibility(path.ParameterNames, bindingDataContract); }
public static void ValidateContractCompatibility <TPath>(this IBindablePath <TPath> path, IReadOnlyDictionary <string, Type> bindingDataContract) { if (path == null) { throw new ArgumentNullException("path"); } IEnumerable <string> parameterNames = path.ParameterNames; if (parameterNames != null) { foreach (string parameterName in parameterNames) { if (bindingDataContract != null && !bindingDataContract.ContainsKey(parameterName)) { throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, "No binding parameter exists for '{0}'.", parameterName)); } } } }