GenericListXamlContentPrivateSetter Sample

Back to summary

Source

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

namespace XmlSerializersTest.Samples
{
    public class GenericListXamlContentPrivateSetter
    {
        public GenericListXamlContentPrivateSetter()
        {
            Strings = new List<string> {"foo", "bar", "baz"};
        }

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public List<string> Strings { get; private set; } 
    }
}

WCF-ref Serializer

<GenericListXamlContentPrivateSetter 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" />