[]
        
(Showing Draft Content)

C1.WPF.RichTextBox.C1RichTextViewManager

C1RichTextViewManager Class

Coordinates the layout and painting of a C1Document.

Inheritance
C1RichTextViewManager
Implements
Namespace: C1.WPF.RichTextBox
Assembly: C1.WPF.RichTextBox.dll
Syntax
public sealed class C1RichTextViewManager : IDisposable
Remarks

C1RichTextViewManager must be used in conjunction with C1RichTextPresenter 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:

<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>

Constructors

Name Description
C1RichTextViewManager()

Constructs a new C1RichTextViewManager.

Properties

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.

Methods

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.

GetPointFromTouchEvent(UIElement, TouchEventArgs)

Returns a point in document coordinates from the position of a touch event.

GetPositionFromPoint(Point)

Returns the closest text position to a given point in the document layout.

GetRectFromPosition(C1TextPointer)

Returns the System.Windows.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.