Открытые поля / свойства класса, производного от BindingList <T>, не будут сериализироваться

Я пытаюсь сериализовать класс, производный отBindingList(Floor), гдеFloor простой класс, который содержит только свойствоFloor.Height

Вот упрощенная версия моего класса

[Serializable]
[XmlRoot(ElementName = "CustomBindingList")]
public class CustomBindingList:BindingList<Floor>
{
    [XmlAttribute("publicField")]
    public string publicField;
    private string privateField;

    [XmlAttribute("PublicProperty")]
    public string PublicProperty
    {
        get { return privateField; }
        set { privateField = value; }
    }
}

Я сериализую экземпляр CustomBindingList, используя следующий код.

XmlSerializer ser = new XmlSerializer(typeof(CustomBindingList));
StringWriter sw = new StringWriter();

CustomBindingList cLIst = new CustomBindingList();

Floor fl;

fl = new Floor();
fl.Height = 10;
cLIst.Add(fl);

fl = new Floor();
fl.Height = 10;    
cLIst.Add(fl);

fl = new Floor();
fl.Height = 10;
cLIst.Add(fl);

ser.Serialize(sw, cLIst);

string testString = sw.ToString();

ЕщеtestString вышеуказанное заканчивается получением следующего XML:

<CustomBindingList xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">
    <Floor Height="10" />
    <Floor Height="10" />
    <Floor Height="10" />
</CustomBindingList>"

Как получить & quot; publicField & quot; или & quot; publicProperty для сериализации?

Ответы на вопрос(3)

Ваш ответ на вопрос