Class
DocumentPresenterBase

Represents the base class for document presenters in the RadRichTextBox. This class provides common functionality for displaying and interacting with documents.

Definition

Namespace:Telerik.Windows.Documents.UI

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

cs-api-definition
public abstract class DocumentPresenterBase : ContentControl, IDocumentEditorPresenter

Inheritance: objectDocumentPresenterBase

Derived Classes: DocumentPrintLayoutPresenterDocumentWebLayoutPresenter

Implements: IDocumentEditorPresenter

Constructors

DocumentPresenterBase()

Declaration

cs-api-definition
public DocumentPresenterBase()

Fields

DragMargin

Declaration

cs-api-definition
protected static readonly double DragMargin

Field Value

double

Properties

CaretPosition

Declaration

cs-api-definition
protected DocumentPosition CaretPosition { get; }

Property Value

DocumentPosition

HorizontalOffset

Gets the horizontal scroll position.

Declaration

cs-api-definition
public double HorizontalOffset { get; }

Property Value

double

Implements IDocumentEditorPresenter.HorizontalOffset

HorizontalScrollOffset

Declaration

cs-api-definition
protected double HorizontalScrollOffset { get; set; }

Property Value

double

IsFocused

Gets a value indicating whether the document presenter is currently focused.

Declaration

cs-api-definition
public abstract bool IsFocused { get; }

Property Value

bool

Implements IDocumentEditorPresenter.IsFocused

KeyboardSelectionHandler

Gets or set the current selection handler.

Declaration

cs-api-definition
public KeyboardSelectionHandler KeyboardSelectionHandler { get; set; }

Property Value

KeyboardSelectionHandler

MouseSelectionHandler

Gets or sets the current selection handler.

Declaration

cs-api-definition
public MouseSelectionHandler MouseSelectionHandler { get; set; }

Property Value

MouseSelectionHandler

Owner

Gets or sets the owner of the DocumentPresenterBase instance.

Declaration

cs-api-definition
public RadRichTextBox Owner { get; set; }

Property Value

RadRichTextBox

The owner associated with the DocumentPresenterBase instance.

Implements IDocumentEditorPresenter.Owner

ScaleFactor

Gets or sets the scale factor of the document presenter.

Declaration

cs-api-definition
public Size ScaleFactor { get; }

Property Value

Size

A double representing the scale factor.

ScrollableHeight

Gets the height that is scrollable within the document presenter.

Declaration

cs-api-definition
public abstract double ScrollableHeight { get; }

Property Value

double

Implements IDocumentEditorPresenter.ScrollableHeight

ScrollableWidth

Gets the scrollable width of the document presenter.

Declaration

cs-api-definition
public abstract double ScrollableWidth { get; }

Property Value

double

Implements IDocumentEditorPresenter.ScrollableWidth

VerticalOffset

Gets the vertical scroll position.

Declaration

cs-api-definition
public double VerticalOffset { get; }

Property Value

double

Implements IDocumentEditorPresenter.VerticalOffset

VerticalScrollOffset

Declaration

cs-api-definition
protected double VerticalScrollOffset { get; set; }

Property Value

double

ViewportHeight

Gets or sets the height of the viewport used by the document presenter.

Declaration

cs-api-definition
public double ViewportHeight { get; }

Property Value

double

A double representing the height of the viewport in pixels.

Implements IDocumentEditorPresenter.ViewportHeight

ViewportWidth

Gets or sets the width of the viewport in the document presenter.

Declaration

cs-api-definition
public double ViewportWidth { get; }

Property Value

double

A double representing the width of the viewport.

Implements IDocumentEditorPresenter.ViewportWidth

Methods

DoOnDocumentChanged()

Executes the actions that should occur when the document is changed.

Declaration

cs-api-definition
public virtual void DoOnDocumentChanged()

Implements IDocumentEditorPresenter.DoOnDocumentChanged()

DoOnDocumentChanging()

Executes actions that need to occur when the document is about to change.

Declaration

cs-api-definition
public virtual void DoOnDocumentChanging()

Implements IDocumentEditorPresenter.DoOnDocumentChanging()

Remarks

This method is typically called before the document is updated to ensure that any necessary preparations or validations are completed.

FocusCaret()

Sets the focus to the caret within the document presenter.

Declaration

cs-api-definition
public abstract void FocusCaret()

Implements IDocumentEditorPresenter.FocusCaret()

GetCurrentPage()

Retrieves the currently displayed page in the document presenter.

Declaration

cs-api-definition
public abstract int GetCurrentPage()

Returns

int

The current page as an instance of type T, representing the content being displayed.

GetCurrentSectionBoundsInViewOverride()

Declaration

cs-api-definition
protected abstract Rect GetCurrentSectionBoundsInViewOverride()

Returns

Rect

GetDocumentPointFromViewPoint(Point)

Converts the specified viewpoint in the document presenter to a document point.

Declaration

cs-api-definition
public abstract Point GetDocumentPointFromViewPoint(Point viewPoint)

Parameters

viewPoint

Point

The viewport point that needs to be converted to a document point.

Returns

Point

A Point representing the corresponding document point derived from the provided viewpoint.

Implements IDocumentEditorPresenter.GetDocumentPointFromViewPoint(Point)

GetDocumentPositionFromViewPoint(Point)

Retrieves the document position corresponding to the specified view point.

Declaration

cs-api-definition
public abstract DocumentPosition GetDocumentPositionFromViewPoint(Point viewPoint)

Parameters

viewPoint

Point

The point in the view for which the document position is to be determined.

Returns

DocumentPosition

A DocumentPosition representing the document position associated with the specified view point.

Implements IDocumentEditorPresenter.GetDocumentPositionFromViewPoint(Point)

GetDropPositionMarker()

Declaration

cs-api-definition
protected abstract DropPositionMarker GetDropPositionMarker()

Returns

DropPositionMarker

GetValidScaleFactor(double, double)

Declaration

cs-api-definition
protected Size GetValidScaleFactor(double width, double height)

Parameters

width

double

height

double

Returns

Size

GetViewPointFromDocumentPosition(DocumentPosition)

Retrieves the viewpoint associated with a specified document position.

Declaration

cs-api-definition
public abstract Point GetViewPointFromDocumentPosition(DocumentPosition position)

Parameters

position

DocumentPosition

The document position from which to obtain the viewpoint.

Returns

Point

The viewpoint corresponding to the specified document position, represented as a generic type T.

Implements IDocumentEditorPresenter.GetViewPointFromDocumentPosition(DocumentPosition)

HandlePageDown()

Handles the Page Down key event, allowing for navigation through document pages.

Declaration

cs-api-definition
public abstract void HandlePageDown()

Implements IDocumentEditorPresenter.HandlePageDown()

HandlePageUp()

Handles the Page Up key press event, allowing navigation to the previous page in the document view.

Declaration

cs-api-definition
public abstract void HandlePageUp()

Implements IDocumentEditorPresenter.HandlePageUp()

HideCaret()

Hides the caret in the document presenter, making it invisible to the user.

Declaration

cs-api-definition
public abstract void HideCaret()

Implements IDocumentEditorPresenter.HideCaret()

HideDropMarker()

Hides the drop marker in the document presenter.

Declaration

cs-api-definition
public void HideDropMarker()

Implements IDocumentEditorPresenter.HideDropMarker()

InvalidateAndUpdateLayout()

Declaration

cs-api-definition
protected void InvalidateAndUpdateLayout()

InvalidateLayout()

Declaration

cs-api-definition
protected void InvalidateLayout()

InvalidatePresenterArrange()

Invalidates the arrangement of the document presenter, causing it to re-evaluate its layout.

Declaration

cs-api-definition
public void InvalidatePresenterArrange()

Implements IDocumentEditorPresenter.InvalidatePresenterArrange()

Remarks

This method is typically called when the content of the document changes, or when the layout needs to be refreshed.

InvalidatePresenterArrangeOverride()

Declaration

cs-api-definition
protected virtual void InvalidatePresenterArrangeOverride()

InvalidatePresenterMeasure()

Invalidates the measurement of the document presenter, forcing it to re-measure its layout. This is typically called when the content or layout changes, ensuring that the visual representation is updated accordingly.

Declaration

cs-api-definition
public void InvalidatePresenterMeasure()

Implements IDocumentEditorPresenter.InvalidatePresenterMeasure()

InvalidatePresenterMeasureOverride()

Declaration

cs-api-definition
protected virtual void InvalidatePresenterMeasureOverride()

IsNavigationKey(Key)

Declaration

cs-api-definition
protected bool IsNavigationKey(Key key)

Parameters

key

Key

Returns

bool

MoveDropMarker(DocumentPosition)

Moves the drop marker to the specified document position.

Declaration

cs-api-definition
public void MoveDropMarker(DocumentPosition documentPosition)

Parameters

documentPosition

DocumentPosition

The document position where the drop marker should be moved.

Implements IDocumentEditorPresenter.MoveDropMarker(DocumentPosition)

OnGotFocus(RoutedEventArgs)

Declaration

cs-api-definition
protected override void OnGotFocus(RoutedEventArgs e)

Parameters

e

RoutedEventArgs

OnKeyUp(KeyEventArgs)

Declaration

cs-api-definition
protected override void OnKeyUp(KeyEventArgs e)

Parameters

e

KeyEventArgs

OnLostFocus(RoutedEventArgs)

Declaration

cs-api-definition
protected override void OnLostFocus(RoutedEventArgs e)

Parameters

e

RoutedEventArgs

OnOwnerChanged()

Declaration

cs-api-definition
protected virtual void OnOwnerChanged()

OnOwnerChanging()

Declaration

cs-api-definition
protected virtual void OnOwnerChanging()

OnPreviewKeyDown(KeyEventArgs)

Declaration

cs-api-definition
protected override void OnPreviewKeyDown(KeyEventArgs e)

Parameters

e

KeyEventArgs

RecreateUI()

Recreates the user interface of the document presenter. This method is typically called to refresh the UI when the underlying document changes.

Declaration

cs-api-definition
public abstract void RecreateUI()

Implements IDocumentEditorPresenter.RecreateUI()

ScrollToHorizontalOffset(double)

Scrolls the content of the document horizontally to the specified offset.

Declaration

cs-api-definition
public void ScrollToHorizontalOffset(double offset)

Parameters

offset

double

The horizontal offset to scroll to, expressed in device-independent units.

Implements IDocumentEditorPresenter.ScrollToHorizontalOffset(double)

ScrollToNote(Note)

Scrolls the document view to the specified note, bringing it into view.

Declaration

cs-api-definition
public abstract void ScrollToNote(Note note)

Parameters

note

Note

The note to which the document view will scroll.

Implements IDocumentEditorPresenter.ScrollToNote(Note)

ScrollToVerticalOffset(double)

Scrolls the document to the specified vertical offset.

Declaration

cs-api-definition
public void ScrollToVerticalOffset(double offset)

Parameters

offset

double

The vertical offset to scroll to, in device-independent units.

Implements IDocumentEditorPresenter.ScrollToVerticalOffset(double)

SetCaretBlinking(bool)

Declaration

cs-api-definition
protected abstract void SetCaretBlinking(bool isBlinking)

Parameters

isBlinking

bool

ShowCaret()

Displays the caret at the current position in the document presenter.

Declaration

cs-api-definition
public abstract void ShowCaret()

Implements IDocumentEditorPresenter.ShowCaret()

ShowDropMarker(DocumentPosition)

Displays a drop marker at the specified document position.

Declaration

cs-api-definition
public void ShowDropMarker(DocumentPosition position)

Parameters

position

DocumentPosition

The document position where the drop marker should be shown.

Implements IDocumentEditorPresenter.ShowDropMarker(DocumentPosition)

UpdateCaretProperties()

Updates the properties of the caret within the document presenter.

Declaration

cs-api-definition
public abstract void UpdateCaretProperties()

Implements IDocumentEditorPresenter.UpdateCaretProperties()

UpdateCaretSize()

Updates the size of the caret in the Document Presenter.

Declaration

cs-api-definition
public abstract void UpdateCaretSize()

Implements IDocumentEditorPresenter.UpdateCaretSize()

UpdateCurrentVisiblePage(int)

Declaration

cs-api-definition
protected void UpdateCurrentVisiblePage(int newValue)

Parameters

newValue

int

UpdateProofingTextDecoration()

Updates the proofing text decoration for the document presenter.

Declaration

cs-api-definition
public abstract void UpdateProofingTextDecoration()

Implements IDocumentEditorPresenter.UpdateProofingTextDecoration()

Remarks

This method applies any necessary decorations to the text based on the current proofing status.

UpdateScrollBar(double, double, ScrollBar, ScrollBarVisibility)

Declaration

cs-api-definition
protected static void UpdateScrollBar(double viewportSize, double max, ScrollBar scrollBar, ScrollBarVisibility suggestedVisibility)

Parameters

viewportSize

double

max

double

scrollBar

ScrollBar

suggestedVisibility

ScrollBarVisibility

UpdateScrollOffsetFromDocumentPosition(DocumentPosition)

Updates the scroll offset based on the specified document position.

Declaration

cs-api-definition
public abstract void UpdateScrollOffsetFromDocumentPosition(DocumentPosition position)

Parameters

position

DocumentPosition

The document position to use for updating the scroll offset.

Implements IDocumentEditorPresenter.UpdateScrollOffsetFromDocumentPosition(DocumentPosition)