ColorProperty Sample

Back to summary

Source

using System.Windows.Media;

namespace XmlSerializersTest.Samples
{
    [Title("Property of type Color")]
    public class ColorProperty
    {
        public Color Color { get; set; }
    }
}

WCF-ref Serializer

<ColorProperty 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">
  <Color xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Windows.Media">
    <d2p1:A>255</d2p1:A>
    <d2p1:B>0</d2p1:B>
    <d2p1:G>0</d2p1:G>
    <d2p1:R>255</d2p1:R>
    <d2p1:ScA>1</d2p1:ScA>
    <d2p1:ScB>0</d2p1:ScB>
    <d2p1:ScG>0</d2p1:ScG>
    <d2p1:ScR>1</d2p1:ScR>
  </Color>
</ColorProperty>