# C1.Win.Themes.C1ThemeController.RegisterTheme

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_Themes_C1ThemeController_RegisterTheme_" data-uid="C1.Win.Themes.C1ThemeController.RegisterTheme*">RegisterTheme Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_Themes_C1ThemeController_RegisterTheme_" data-uid="C1.Win.Themes.C1ThemeController.RegisterTheme*"></a>
<h4 id="C1_Win_Themes_C1ThemeController_RegisterTheme_System_IO_Stream_C1_Win_Themes_C1ThemeFormat_" data-uid="C1.Win.Themes.C1ThemeController.RegisterTheme(System.IO.Stream,C1.Win.Themes.C1ThemeFormat)">RegisterTheme(Stream, C1ThemeFormat)</h4>
<div class="markdown level1 summary"><p>Loads a theme from a stream, and registeres it for use by theme controllers
in the application.</p>
<p>After this method completes, the theme can be set via
<a class="xref" href="C1.Win.Themes.C1ThemeController.ApplicationTheme.html#C1_Win_Themes_C1ThemeController_ApplicationTheme">ApplicationTheme</a> and <a class="xref" href="C1.Win.Themes.C1ThemeController.Theme.html#C1_Win_Themes_C1ThemeController_Theme">Theme</a> properties.</p>
<p>his method throws an exception if a theme with same name has already been registered.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static string RegisterTheme(Stream stream, C1ThemeFormat format)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function RegisterTheme(stream As Stream, format As C1ThemeFormat) As String</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><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a></td>
      <td><span class="parametername">stream</span></td>
      <td><p>A stream containing the theme to load/register.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Win.Themes.C1ThemeFormat.html">C1ThemeFormat</a></td>
      <td><span class="parametername">format</span></td>
      <td><p>The theme persitence format to use.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><p>A name of registered theme.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Win_Themes_C1ThemeController_RegisterTheme_" data-uid="C1.Win.Themes.C1ThemeController.RegisterTheme*"></a>
<h4 id="C1_Win_Themes_C1ThemeController_RegisterTheme_System_IO_Stream_" data-uid="C1.Win.Themes.C1ThemeController.RegisterTheme(System.IO.Stream)">RegisterTheme(Stream)</h4>
<div class="markdown level1 summary"><p>Loads a theme from a stream, and registeres it for use by theme controllers
in the application.</p>
<p>After this method completes, the theme can be set via
<a class="xref" href="C1.Win.Themes.C1ThemeController.ApplicationTheme.html#C1_Win_Themes_C1ThemeController_ApplicationTheme">ApplicationTheme</a> and <a class="xref" href="C1.Win.Themes.C1ThemeController.Theme.html#C1_Win_Themes_C1ThemeController_Theme">Theme</a> properties.</p>
<p>his method throws an exception if a theme with same name has already been registered.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static string RegisterTheme(Stream stream)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function RegisterTheme(stream As Stream) As String</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><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a></td>
      <td><span class="parametername">stream</span></td>
      <td><p>A stream containing the theme to load/register.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><p>A name of registered theme.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Win_Themes_C1ThemeController_RegisterTheme_" data-uid="C1.Win.Themes.C1ThemeController.RegisterTheme*"></a>
<h4 id="C1_Win_Themes_C1ThemeController_RegisterTheme_System_String_" data-uid="C1.Win.Themes.C1ThemeController.RegisterTheme(System.String)">RegisterTheme(string)</h4>
<div class="markdown level1 summary"><p>Loads a theme from a file, and registeres it for use by theme controllers
in the application.</p>
<p>After this method completes, the theme can be set via
<a class="xref" href="C1.Win.Themes.C1ThemeController.ApplicationTheme.html#C1_Win_Themes_C1ThemeController_ApplicationTheme">ApplicationTheme</a> and <a class="xref" href="C1.Win.Themes.C1ThemeController.Theme.html#C1_Win_Themes_C1ThemeController_Theme">Theme</a> properties.</p>
<p>his method throws an exception if a theme with same name has already been registered.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static string RegisterTheme(string fileName)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function RegisterTheme(fileName As String) As String</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><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">fileName</span></td>
      <td><p>The file containing the theme to load/register.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><p>A name of registered theme.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
