# C1.WPF.RichTextBox.IStyleOverride

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_WPF_RichTextBox_IStyleOverride" data-uid="C1.WPF.RichTextBox.IStyleOverride" class="text-break">IStyleOverride Interface
</h1>
  <div class="markdown level0 summary"><p>This interface is implemented to provide style overrides to a <a class="xref" href="C1.WPF.RichTextBox.C1RichTextBox.html">C1RichTextBox</a>.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.WPF.RichTextBox.html">C1.WPF.RichTextBox</a></h6>
  <h6><strong>Assembly</strong>: C1.WPF.RichTextBox.dll</h6>
  <h5 id="C1_WPF_RichTextBox_IStyleOverride_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public interface IStyleOverride</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Interface IStyleOverride</code></pre>
  </div>
  <h5 id="C1_WPF_RichTextBox_IStyleOverride_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><p>
A style override is a way to modify the style of a <a class="xref" href="C1.WPF.RichTextBox.Documents.C1Document.html">C1Document</a> displayed in a <a class="xref" href="C1.WPF.RichTextBox.C1RichTextBox.html">C1RichTextBox</a> 
without modifying the document.
</p>
<p>
There are two approaches to implementing this interface. An implementation could either calculate the collection of <a class="xref" href="C1.WPF.RichTextBox.C1RangeStyle.html">C1RangeStyle</a>
each time <a class="xref" href="C1.WPF.RichTextBox.IStyleOverride.GetStyles.html#C1_WPF_RichTextBox_IStyleOverride_GetStyles_C1_WPF_RichTextBox_Documents_C1TextRange_">GetStyles(C1TextRange)</a> is called, or have a pre calculated collection of C1RangeStyle, and return the ones inside the range passed as a parameter to GetStyles.
For the second approach, the use of <a class="xref" href="C1.WPF.RichTextBox.C1RangeStyleCollection.html">C1RangeStyleCollection</a> is recommended.
</p>
<p>
Note that only style properties that do not change the layout of the document can be overridden. As an example, <a class="xref" href="C1.WPF.RichTextBox.Documents.C1TextElement.FontWeightProperty.html">FontWeightProperty</a> cannot
be overridden, but <a class="xref" href="C1.WPF.RichTextBox.Documents.C1TextElement.ForegroundProperty.html">ForegroundProperty</a> can.
</p>
</div>
  <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_RichTextBox_IStyleOverride_GetStyles_C1_WPF_RichTextBox_Documents_C1TextRange_" data-uid="C1.WPF.RichTextBox.IStyleOverride.GetStyles(C1.WPF.RichTextBox.Documents.C1TextRange)">
          <a class="xref" href="C1.WPF.RichTextBox.IStyleOverride.GetStyles.html#C1_WPF_RichTextBox_IStyleOverride_GetStyles_C1_WPF_RichTextBox_Documents_C1TextRange_">GetStyles(C1TextRange)</a>
        </td>
        <td class="markdown level1 summary"><p>Returns a collection of <a class="xref" href="C1.WPF.RichTextBox.C1RangeStyle.html">C1RangeStyle</a> objects to apply to the text inside the parameter <a class="xref" href="C1.WPF.RichTextBox.Documents.C1TextRange.html">C1TextRange</a>.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="events">Events
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_RichTextBox_IStyleOverride_StylesChanged" data-uid="C1.WPF.RichTextBox.IStyleOverride.StylesChanged">
          <a class="xref" href="C1.WPF.RichTextBox.IStyleOverride.StylesChanged.html">StylesChanged</a>
        </td>
        <td class="markdown level1 summary"><p>Fired when the styles of this <a class="xref" href="C1.WPF.RichTextBox.IStyleOverride.html">IStyleOverride</a> change.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
