2011-01-29 62 views
0
No matching constructor found on type 'XYZ'. You can use the Arguments or FactoryMethod directives to construct this type. 

我序列化了一个usercontrol。它没有给出任何错误,并成功完成,但反序列化,我得到了以上例外。未找到XAML序列化/类型 - 需要帮助!

类型的构造函数需要参数,它不能为null。所以,PLZ帮助我解决这个错误。

+0

你有什么代码可以显示吗?另外,你为什么要首先序列化UserControl?你可以把任何额外的资源放到一个单独的程序集中并加载。 – 2011-01-29 13:18:48

回答

0

您应该尝试遵循this article的建议,该建议详细描述了如何创建可以使用XamlWriter和XamlReader序列化的自定义类型。

您可能还想看看参数和FactoryMethod指令所做的explanation