# C1.WPF.Core.C1BrushXmlSerializer.WriteBrush

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_WPF_Core_C1BrushXmlSerializer_WriteBrush_" data-uid="C1.WPF.Core.C1BrushXmlSerializer.WriteBrush*">WriteBrush Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_WPF_Core_C1BrushXmlSerializer_WriteBrush_" data-uid="C1.WPF.Core.C1BrushXmlSerializer.WriteBrush*"></a>
<h4 id="C1_WPF_Core_C1BrushXmlSerializer_WriteBrush_System_Xml_XmlWriter_System_Windows_Media_Brush_System_String_" data-uid="C1.WPF.Core.C1BrushXmlSerializer.WriteBrush(System.Xml.XmlWriter,System.Windows.Media.Brush,System.String)">WriteBrush(XmlWriter, Brush, string)</h4>
<div class="markdown level1 summary"><p>Serializes Brush in XML.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static void WriteBrush(this XmlWriter writer, Brush brush, string propertyName = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Sub WriteBrush(writer As XmlWriter, brush As Brush, Optional propertyName As String = Nothing)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="xref">XmlWriter</span></td>
      <td><span class="parametername">writer</span></td>
      <td><p>The <span class="xref">System.Xml.XmlWriter</span> stream to which the object is serialized.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.media.brush">Brush</a></td>
      <td><span class="parametername">brush</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.media.brush">Brush</a> to serialize.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">propertyName</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentnullexception">ArgumentNullException</a></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.notsupportedexception">NotSupportedException</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
