0
我有一個用戶控件。屬性不可序列化錯誤
public partial class UserControl1 : UserControl
{
public UserControl1()
{
InitializeComponent();
}
public List<Person> People
{
get
{
return new List<Person>();
}
set
{
throw new NotImplementedException();
}
}
}
如果我將此控件拖到窗體上,我得到一個序列化錯誤。錯誤的變化取決於我是否第一次拖動控件,刪除控件等等。常數是,如果我讓Person可序列化,那麼錯誤就會消失。爲什麼在將元素拖放到表單上時發生錯誤?典型的修復是什麼?
我想你可以告訴設計師這是一個「非財產」。 – 2012-05-03 18:01:23