# C1.WPF.RichTextBox.C1RichTextViewManager

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_WPF_RichTextBox_C1RichTextViewManager" data-uid="C1.WPF.RichTextBox.C1RichTextViewManager" class="text-break">C1RichTextViewManager Class
</h1>
  <div class="markdown level0 summary"><p>Coordinates the layout and painting of a <a class="xref" href="C1.WPF.RichTextBox.Documents.C1Document.html">C1Document</a>.</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"><span class="xref">C1RichTextViewManager</span></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></div>
  </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.4.6.2.dll</h6>
  <h5 id="C1_WPF_RichTextBox_C1RichTextViewManager_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public sealed class C1RichTextViewManager : IDisposable</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public NotInheritable Class C1RichTextViewManager
    Implements IDisposable</code></pre>
  </div>
  <h5 id="C1_WPF_RichTextBox_C1RichTextViewManager_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><pre><code>&lt;p&gt;
    &lt;xref href=&quot;C1.WPF.RichTextBox.C1RichTextViewManager&quot; data-throw-if-not-resolved=&quot;false&quot;&gt;&lt;/xref&gt; must be used in conjunction with &lt;xref href=&quot;C1.WPF.RichTextBox.C1RichTextPresenter&quot; data-throw-if-not-resolved=&quot;false&quot;&gt;&lt;/xref&gt; to
</code></pre>
<p>display rich text. The <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.Presenters.html#C1_WPF_RichTextBox_C1RichTextViewManager_Presenters">Presenters</a> collection contains <a class="xref" href="C1.WPF.RichTextBox.C1RichTextPresenterSource.html">C1RichTextPresenterSource</a>s
that connect the C1RichTextViewManager with the <a class="xref" href="C1.WPF.RichTextBox.C1RichTextPresenter.html">C1RichTextPresenter</a>s that actually displays the content.</p>

    <p>
The <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.Presenters.html#C1_WPF_RichTextBox_C1RichTextViewManager_Presenters">Presenters</a> collection always contains at least one element, and grows or shrinks when new presenters are needed.
This makes it suitable to be used with an <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.controls.itemscontrol">ItemsControl</a> to create new presenters as needed. This is a sample of an ItemsControl
displaying a <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.Document.html#C1_WPF_RichTextBox_C1RichTextViewManager_Document">Document</a>:
</p>
<pre><code>&lt;pre&gt;&lt;code class=&quot;lang-XAML&quot;&gt;&lt;Grid&gt;
    &lt;Grid.Resources&gt;
        &lt;c1rtb:C1RichTextViewManager x:Key=&quot;viewManager&quot; Document=&quot;{StaticResource someDocument}&quot;/&gt;
    &lt;/Grid.Resources&gt;
    &lt;ItemsControl ItemsSource=&quot;{Binding Presenters, Source={StaticResource viewManager}}&quot;&gt;
        &lt;ItemsControl.ItemTemplate&gt;
            &lt;DataTemplate&gt;
                &lt;Border Margin=&quot;10&quot; BorderThickness=&quot;2&quot; BorderBrush=&quot;Red&quot; Padding=&quot;2&quot; Height=&quot;102&quot;&gt;
                    &lt;c1rtb:C1RichTextPresenter Source=&quot;{Binding}&quot;/&gt;
                &lt;/Border&gt;
            &lt;/DataTemplate&gt;
        &lt;/ItemsControl.ItemTemplate&gt;
    &lt;/ItemsControl&gt;
&lt;/Grid&gt;&lt;/code&gt;&lt;/pre&gt;
</code></pre>
</div>
  <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_RichTextBox_C1RichTextViewManager__ctor" data-uid="C1.WPF.RichTextBox.C1RichTextViewManager.#ctor">
          <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.-ctor.html#C1_WPF_RichTextBox_C1RichTextViewManager__ctor">C1RichTextViewManager()</a>
        </td>
        <td class="markdown level1 summary"><p>Constructs a new <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.html">C1RichTextViewManager</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_RichTextBox_C1RichTextViewManager_Document" data-uid="C1.WPF.RichTextBox.C1RichTextViewManager.Document">
          <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.Document.html#C1_WPF_RichTextBox_C1RichTextViewManager_Document">Document</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the <a class="xref" href="C1.WPF.RichTextBox.Documents.C1Document.html">C1Document</a> associated with this <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.html">C1RichTextViewManager</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_RichTextBox_C1RichTextViewManager_Painter" data-uid="C1.WPF.RichTextBox.C1RichTextViewManager.Painter">
          <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.Painter.html#C1_WPF_RichTextBox_C1RichTextViewManager_Painter">Painter</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a <a class="xref" href="C1.WPF.RichTextBox.IRichTextPainter.html">IRichTextPainter</a> that can customize the painting of this <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.html">C1RichTextViewManager</a> contents.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_RichTextBox_C1RichTextViewManager_PresenterInfo" data-uid="C1.WPF.RichTextBox.C1RichTextViewManager.PresenterInfo">
          <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.PresenterInfo.html#C1_WPF_RichTextBox_C1RichTextViewManager_PresenterInfo">PresenterInfo</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets an object that can be accessed through bindings in each presenter.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_RichTextBox_C1RichTextViewManager_Presenters" data-uid="C1.WPF.RichTextBox.C1RichTextViewManager.Presenters">
          <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.Presenters.html#C1_WPF_RichTextBox_C1RichTextViewManager_Presenters">Presenters</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the collection of <a class="xref" href="C1.WPF.RichTextBox.C1RichTextPresenterSource.html">C1RichTextPresenterSource</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_RichTextBox_C1RichTextViewManager_StyleOverride" data-uid="C1.WPF.RichTextBox.C1RichTextViewManager.StyleOverride">
          <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.StyleOverride.html#C1_WPF_RichTextBox_C1RichTextViewManager_StyleOverride">StyleOverride</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a <a class="xref" href="C1.WPF.RichTextBox.IStyleOverride.html">IStyleOverride</a> that can override the styles of this <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.html">C1RichTextViewManager</a> contents.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_RichTextBox_C1RichTextViewManager_TabSize" data-uid="C1.WPF.RichTextBox.C1RichTextViewManager.TabSize">
          <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.TabSize.html#C1_WPF_RichTextBox_C1RichTextViewManager_TabSize">TabSize</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the width of a tab in whitespaces.</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_RichTextBox_C1RichTextViewManager_Dispose" data-uid="C1.WPF.RichTextBox.C1RichTextViewManager.Dispose">
          <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.Dispose.html#C1_WPF_RichTextBox_C1RichTextViewManager_Dispose">Dispose()</a>
        </td>
        <td class="markdown level1 summary"><p>Detaches the <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.html">C1RichTextViewManager</a> from its <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.Document.html#C1_WPF_RichTextBox_C1RichTextViewManager_Document">Document</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_RichTextBox_C1RichTextViewManager_GetElementFromPoint_System_Windows_Point_" data-uid="C1.WPF.RichTextBox.C1RichTextViewManager.GetElementFromPoint(System.Windows.Point)">
          <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.GetElementFromPoint.html#C1_WPF_RichTextBox_C1RichTextViewManager_GetElementFromPoint_System_Windows_Point_">GetElementFromPoint(Point)</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the <a class="xref" href="C1.WPF.RichTextBox.Documents.C1TextElement.html">C1TextElement</a> directly below a given point.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_RichTextBox_C1RichTextViewManager_GetLine_C1_WPF_RichTextBox_Documents_C1TextPointer_" data-uid="C1.WPF.RichTextBox.C1RichTextViewManager.GetLine(C1.WPF.RichTextBox.Documents.C1TextPointer)">
          <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.GetLine.html#C1_WPF_RichTextBox_C1RichTextViewManager_GetLine_C1_WPF_RichTextBox_Documents_C1TextPointer_">GetLine(C1TextPointer)</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the inner <a class="xref" href="C1.WPF.RichTextBox.C1Line.html">C1Line</a> that contains a <a class="xref" href="C1.WPF.RichTextBox.Documents.C1TextPointer.html">C1TextPointer</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_RichTextBox_C1RichTextViewManager_GetPointFromMouseEvent_System_Windows_UIElement_System_Windows_Input_MouseEventArgs_" data-uid="C1.WPF.RichTextBox.C1RichTextViewManager.GetPointFromMouseEvent(System.Windows.UIElement,System.Windows.Input.MouseEventArgs)">
          <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.GetPointFromMouseEvent.html#C1_WPF_RichTextBox_C1RichTextViewManager_GetPointFromMouseEvent_System_Windows_UIElement_System_Windows_Input_MouseEventArgs_">GetPointFromMouseEvent(UIElement, MouseEventArgs)</a>
        </td>
        <td class="markdown level1 summary"><p>Returns a point in document coordinates from the position of a mouse event.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_RichTextBox_C1RichTextViewManager_GetPointFromRelativePoint_System_Windows_UIElement_System_Windows_Point_" data-uid="C1.WPF.RichTextBox.C1RichTextViewManager.GetPointFromRelativePoint(System.Windows.UIElement,System.Windows.Point)">
          <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.GetPointFromRelativePoint.html#C1_WPF_RichTextBox_C1RichTextViewManager_GetPointFromRelativePoint_System_Windows_UIElement_System_Windows_Point_">GetPointFromRelativePoint(UIElement, Point)</a>
        </td>
        <td class="markdown level1 summary"><p>Returns a point in document coordinates from a point relative to a <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.uielement">UIElement</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_RichTextBox_C1RichTextViewManager_GetPositionFromPoint_System_Windows_Point_" data-uid="C1.WPF.RichTextBox.C1RichTextViewManager.GetPositionFromPoint(System.Windows.Point)">
          <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.GetPositionFromPoint.html#C1_WPF_RichTextBox_C1RichTextViewManager_GetPositionFromPoint_System_Windows_Point_">GetPositionFromPoint(Point)</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the closest text position to a given point in the document layout.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_RichTextBox_C1RichTextViewManager_GetRectFromPosition_C1_WPF_RichTextBox_Documents_C1TextPointer_" data-uid="C1.WPF.RichTextBox.C1RichTextViewManager.GetRectFromPosition(C1.WPF.RichTextBox.Documents.C1TextPointer)">
          <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.GetRectFromPosition.html#C1_WPF_RichTextBox_C1RichTextViewManager_GetRectFromPosition_C1_WPF_RichTextBox_Documents_C1TextPointer_">GetRectFromPosition(C1TextPointer)</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.rect">Rect</a> of document layout coordinates for a given position.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_RichTextBox_C1RichTextViewManager_GetRelativePointFromPoint_System_Windows_UIElement_System_Windows_Point_" data-uid="C1.WPF.RichTextBox.C1RichTextViewManager.GetRelativePointFromPoint(System.Windows.UIElement,System.Windows.Point)">
          <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.GetRelativePointFromPoint.html#C1_WPF_RichTextBox_C1RichTextViewManager_GetRelativePointFromPoint_System_Windows_UIElement_System_Windows_Point_">GetRelativePointFromPoint(UIElement, Point)</a>
        </td>
        <td class="markdown level1 summary"><p>Returns a point relative to an element from a point in document coordinates.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_RichTextBox_C1RichTextViewManager_GetView_C1_WPF_RichTextBox_Documents_C1TextElement_" data-uid="C1.WPF.RichTextBox.C1RichTextViewManager.GetView(C1.WPF.RichTextBox.Documents.C1TextElement)">
          <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.GetView.html#C1_WPF_RichTextBox_C1RichTextViewManager_GetView_C1_WPF_RichTextBox_Documents_C1TextElement_">GetView(C1TextElement)</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the view associated with a given <a class="xref" href="C1.WPF.RichTextBox.Documents.C1TextElement.html">C1TextElement</a> in this <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.html">C1RichTextViewManager</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_RichTextBox_C1RichTextViewManager_InvalidatePaint" data-uid="C1.WPF.RichTextBox.C1RichTextViewManager.InvalidatePaint">
          <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.InvalidatePaint.html#C1_WPF_RichTextBox_C1RichTextViewManager_InvalidatePaint">InvalidatePaint()</a>
        </td>
        <td class="markdown level1 summary"><p>Forces a new paint pass.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_RichTextBox_C1RichTextViewManager_OfflinePaint_System_Windows_Size_" data-uid="C1.WPF.RichTextBox.C1RichTextViewManager.OfflinePaint(System.Windows.Size)">
          <a class="xref" href="C1.WPF.RichTextBox.C1RichTextViewManager.OfflinePaint.html#C1_WPF_RichTextBox_C1RichTextViewManager_OfflinePaint_System_Windows_Size_">OfflinePaint(Size)</a>
        </td>
        <td class="markdown level1 summary"><p>Paint rich text outside the visual tree.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
