GenericListXamlContent Sample

Back to summary

Source

using System.Collections.Generic;
using System.ComponentModel;

namespace XmlSerializersTest.Samples
{
    [Title("Generic list with Content attribute")]
    public class GenericListXamlContent
    {
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public List<string> Strings { get; set; }
    }
}

WCF-ref Serializer

<GenericListXamlContent xmlns:i="http://www.w3.org/2001/XMLSchema-instance" z:Id="1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" xmlns="http://schemas.datacontract.org/2004/07/XmlSerializersTest.Samples">
  <Strings xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" z:Id="2" z:Size="3">
    <d2p1:string z:Id="3">foo</d2p1:string>
    <d2p1:string z:Id="4">bar</d2p1:string>
    <d2p1:string z:Id="5">baz</d2p1:string>
  </Strings>
</GenericListXamlContent>