[]
Coordinates the layout and painting of a C1Document.
public sealed class C1RichTextViewManager : IDisposable
<p>
<xref href="C1.WPF.RichTextBox.C1RichTextViewManager" data-throw-if-not-resolved="false"></xref> must be used in conjunction with <xref href="C1.WPF.RichTextBox.C1RichTextPresenter" data-throw-if-not-resolved="false"></xref> to
display rich text. The Presenters collection contains C1RichTextPresenterSources that connect the C1RichTextViewManager with the C1RichTextPresenters that actually displays the content.
The Presenters 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 ItemsControl to create new presenters as needed. This is a sample of an ItemsControl displaying a Document:
<pre><code class="lang-XAML"><Grid>
<Grid.Resources>
<c1rtb:C1RichTextViewManager x:Key="viewManager" Document="{StaticResource someDocument}"/>
</Grid.Resources>
<ItemsControl ItemsSource="{Binding Presenters, Source={StaticResource viewManager}}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Margin="10" BorderThickness="2" BorderBrush="Red" Padding="2" Height="102">
<c1rtb:C1RichTextPresenter Source="{Binding}"/>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid></code></pre>
Name | Description |
---|---|
C1RichTextViewManager() | Constructs a new C1RichTextViewManager. |
Name | Description |
---|---|
Document | Gets or sets the C1Document associated with this C1RichTextViewManager. |
Painter | Gets or sets a IRichTextPainter that can customize the painting of this C1RichTextViewManager contents. |
PresenterInfo | Gets or sets an object that can be accessed through bindings in each presenter. |
Presenters | Gets the collection of C1RichTextPresenterSource. |
StyleOverride | Gets or sets a IStyleOverride that can override the styles of this C1RichTextViewManager contents. |
TabSize | Gets or sets the width of a tab in whitespaces. |
Name | Description |
---|---|
Dispose() | Detaches the C1RichTextViewManager from its Document. |
GetElementFromPoint(Point) | Returns the C1TextElement directly below a given point. |
GetLine(C1TextPointer) | Returns the inner C1Line that contains a C1TextPointer. |
GetPointFromMouseEvent(UIElement, MouseEventArgs) | Returns a point in document coordinates from the position of a mouse event. |
GetPointFromRelativePoint(UIElement, Point) | Returns a point in document coordinates from a point relative to a UIElement. |
GetPositionFromPoint(Point) | Returns the closest text position to a given point in the document layout. |
GetRectFromPosition(C1TextPointer) | Returns the Rect of document layout coordinates for a given position. |
GetRelativePointFromPoint(UIElement, Point) | Returns a point relative to an element from a point in document coordinates. |
GetView(C1TextElement) | Gets the view associated with a given C1TextElement in this C1RichTextViewManager. |
InvalidatePaint() | Forces a new paint pass. |
OfflinePaint(Size) | Paint rich text outside the visual tree. |