# C1.WPF.Binding.C1StaticResource

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_WPF_Binding_C1StaticResource" data-uid="C1.WPF.Binding.C1StaticResource" class="text-break">C1StaticResource Class
</h1>
  <div class="markdown level0 summary"><p>A <b>StaticResource</b> that supports a path specification.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.markup.markupextension">MarkupExtension</a></div>
    <div class="level2"><span class="xref">C1StaticResource</span></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.WPF.Binding.html">C1.WPF.Binding</a></h6>
  <h6><strong>Assembly</strong>: C1.WPF.Binding.4.6.2.dll</h6>
  <h5 id="C1_WPF_Binding_C1StaticResource_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class C1StaticResource : MarkupExtension</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class C1StaticResource
    Inherits MarkupExtension</code></pre>
  </div>
  <h5 id="C1_WPF_Binding_C1StaticResource_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><pre><code>&lt;p&gt;The &lt;b&gt;C1StaticResource&lt;/b&gt; class is similar to a regular 
</code></pre>
<p><b>StaticResource</b> markup, but supports a path specification
instead of simple objects.</p>
<p>Paths are specified using the same expression syntax used in
the <a class="xref" href="C1.WPF.Binding.C1Binding.html">C1Binding</a> class. This allows you to use object members
as resources.</p>

</div>
  <h5 id="C1_WPF_Binding_C1StaticResource_examples"><strong>Examples</strong></h5>
  <p>The XAML below uses the <b>C1StaticResource</b> class to bind a grid
column using a value converter that is implemented in a
<b>ViewModel</b> object.</p>
<pre><code class="lang-csharp">&lt;c1:C1FlexGrid
  ItemsSource="{Binding Source={StaticResource _model}, Path=People}"
  AutoGenerateColumns="False" &gt;
  &lt;c1:C1FlexGrid.Columns&gt;
    &lt;c1:Column 
      Binding="{Binding JobID, 
        Mode=TwoWay, 
        Converter={c1:C1StaticResource Key=_model,Path=JobsConverter}}" /&gt;
  &lt;/c1:C1FlexGrid.Columns&gt;
&lt;/c1:C1FlexGrid&gt;</code></pre>
<p>The XAML snippet above assigns the <b>_model.JobsConverter</b> object
to the <b>Converter</b> property of the binding. This cannot be done
using a nested binding because the <b>Binding</b> class is not a
dependency object.</p>

  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_Binding_C1StaticResource__ctor" data-uid="C1.WPF.Binding.C1StaticResource.#ctor">
          <a class="xref" href="C1.WPF.Binding.C1StaticResource.-ctor.html#C1_WPF_Binding_C1StaticResource__ctor">C1StaticResource()</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of a <a class="xref" href="C1.WPF.Binding.C1StaticResource.html">C1StaticResource</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Binding_C1StaticResource__ctor_System_String_" data-uid="C1.WPF.Binding.C1StaticResource.#ctor(System.String)">
          <a class="xref" href="C1.WPF.Binding.C1StaticResource.-ctor.html#C1_WPF_Binding_C1StaticResource__ctor_System_String_">C1StaticResource(string)</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of a <a class="xref" href="C1.WPF.Binding.C1StaticResource.html">C1StaticResource</a>.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_Binding_C1StaticResource_Key" data-uid="C1.WPF.Binding.C1StaticResource.Key">
          <a class="xref" href="C1.WPF.Binding.C1StaticResource.Key.html#C1_WPF_Binding_C1StaticResource_Key">Key</a>
        </td>
        <td class="markdown level1 summary"><p>Key that identifies the resource.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Binding_C1StaticResource_Path" data-uid="C1.WPF.Binding.C1StaticResource.Path">
          <a class="xref" href="C1.WPF.Binding.C1StaticResource.Path.html#C1_WPF_Binding_C1StaticResource_Path">Path</a>
        </td>
        <td class="markdown level1 summary"><p>Expression that defines the data to extract from the resource.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_Binding_C1StaticResource_ProvideValue_System_IServiceProvider_" data-uid="C1.WPF.Binding.C1StaticResource.ProvideValue(System.IServiceProvider)">
          <a class="xref" href="C1.WPF.Binding.C1StaticResource.ProvideValue.html#C1_WPF_Binding_C1StaticResource_ProvideValue_System_IServiceProvider_">ProvideValue(IServiceProvider)</a>
        </td>
        <td class="markdown level1 summary"><p>Returns an object that is provided as the value of this markup extension.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
