Ответ 1
Кажется, что Validator не соблюдает атрибут MetadataTypeAttribute:
http://forums.silverlight.net/forums/p/149264/377212.aspx
Взаимосвязь должна быть зарегистрирована в виде:
TypeDescriptor.AddProviderTransparent(
new AssociatedMetadataTypeTypeDescriptionProvider(
typeof(Stuff),
typeof(StuffMetadata)),
typeof(Stuff));
Этот вспомогательный класс будет регистрировать все отношения метаданных в сборке:
public static class MetadataTypesRegister
{
static bool installed = false;
static object installedLock = new object();
public static void InstallForThisAssembly()
{
if (installed)
{
return;
}
lock (installedLock)
{
if (installed)
{
return;
}
foreach (Type type in Assembly.GetExecutingAssembly().GetTypes())
{
foreach (MetadataTypeAttribute attrib in type.GetCustomAttributes(typeof(MetadataTypeAttribute), true))
{
TypeDescriptor.AddProviderTransparent(
new AssociatedMetadataTypeTypeDescriptionProvider(type, attrib.MetadataClassType), type);
}
}
installed = true;
}
}
}