New to Telerik UI for WPFStart a free 30-day trial

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:

C#
public abstract class DocumentPresenterBase : ContentControl, IDocumentEditorPresenter

Inheritance: objectDocumentPresenterBase

Derived Classes: DocumentPrintLayoutPresenterDocumentWebLayoutPresenter

Implements: IDocumentEditorPresenter

Constructors

C#
public DocumentPresenterBase()

Fields

C#
protected static readonly double DragMargin

Properties

C#
protected DocumentPosition CaretPosition { get; }

Gets the horizontal scroll position.

C#
public double HorizontalOffset { get; }

Implements: IDocumentEditorPresenter.HorizontalOffset

C#
protected double HorizontalScrollOffset { get; set; }

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

C#
public abstract bool IsFocused { get; }

Implements: IDocumentEditorPresenter.IsFocused

Gets or set the current selection handler.

C#
public KeyboardSelectionHandler KeyboardSelectionHandler { get; set; }

Gets or sets the current selection handler.

C#
public MouseSelectionHandler MouseSelectionHandler { get; set; }

Gets or sets the owner of the DocumentPresenterBase instance.

C#
public RadRichTextBox Owner { get; set; }
Property Value:

The owner associated with the DocumentPresenterBase instance.

Implements: IDocumentEditorPresenter.Owner

Gets or sets the scale factor of the document presenter.

C#
public Size ScaleFactor { get; }
Property Value:

A double representing the scale factor.

Gets the height that is scrollable within the document presenter.

C#
public abstract double ScrollableHeight { get; }

Implements: IDocumentEditorPresenter.ScrollableHeight

Gets the scrollable width of the document presenter.

C#
public abstract double ScrollableWidth { get; }

Implements: IDocumentEditorPresenter.ScrollableWidth

Gets the vertical scroll position.

C#
public double VerticalOffset { get; }

Implements: IDocumentEditorPresenter.VerticalOffset

C#
protected double VerticalScrollOffset { get; set; }

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

C#
public double ViewportHeight { get; }
Property Value:

A double representing the height of the viewport in pixels.

Implements: IDocumentEditorPresenter.ViewportHeight

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

C#
public double ViewportWidth { get; }
Property Value:

A double representing the width of the viewport.

Implements: IDocumentEditorPresenter.ViewportWidth

Methods

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

C#
public virtual void DoOnDocumentChanged()

Implements: IDocumentEditorPresenter.DoOnDocumentChanged()

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

C#
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.

Sets the focus to the caret within the document presenter.

C#
public abstract void FocusCaret()

Implements: IDocumentEditorPresenter.FocusCaret()

Retrieves the currently displayed page in the document presenter.

C#
public abstract int GetCurrentPage()
Returns:

int

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

C#
protected abstract Rect GetCurrentSectionBoundsInViewOverride()
Returns:

Rect

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

C#
public abstract Point GetDocumentPointFromViewPoint(Point viewPoint)
Parameters:viewPointPoint

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)

Retrieves the document position corresponding to the specified view point.

C#
public abstract DocumentPosition GetDocumentPositionFromViewPoint(Point viewPoint)
Parameters:viewPointPoint

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)

C#
protected abstract DropPositionMarker GetDropPositionMarker()
Returns:

DropPositionMarker

C#
protected Size GetValidScaleFactor(double width, double height)
Parameters:widthdoubleheightdoubleReturns:

Size

Retrieves the viewpoint associated with a specified document position.

C#
public abstract Point GetViewPointFromDocumentPosition(DocumentPosition position)
Parameters:positionDocumentPosition

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)

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

C#
public abstract void HandlePageDown()

Implements: IDocumentEditorPresenter.HandlePageDown()

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

C#
public abstract void HandlePageUp()

Implements: IDocumentEditorPresenter.HandlePageUp()

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

C#
public abstract void HideCaret()

Implements: IDocumentEditorPresenter.HideCaret()

Hides the drop marker in the document presenter.

C#
public void HideDropMarker()

Implements: IDocumentEditorPresenter.HideDropMarker()

C#
protected void InvalidateAndUpdateLayout()
C#
protected void InvalidateLayout()

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

C#
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.

C#
protected virtual void InvalidatePresenterArrangeOverride()

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.

C#
public void InvalidatePresenterMeasure()

Implements: IDocumentEditorPresenter.InvalidatePresenterMeasure()

C#
protected virtual void InvalidatePresenterMeasureOverride()
C#
protected bool IsNavigationKey(Key key)
Parameters:keyKeyReturns:

bool

Moves the drop marker to the specified document position.

C#
public void MoveDropMarker(DocumentPosition documentPosition)
Parameters:documentPositionDocumentPosition

The document position where the drop marker should be moved.

Implements: IDocumentEditorPresenter.MoveDropMarker(DocumentPosition)

C#
protected override void OnGotFocus(RoutedEventArgs e)
Parameters:eRoutedEventArgs
C#
protected override void OnKeyUp(KeyEventArgs e)
Parameters:eKeyEventArgs
C#
protected override void OnLostFocus(RoutedEventArgs e)
Parameters:eRoutedEventArgs
C#
protected virtual void OnOwnerChanged()
C#
protected virtual void OnOwnerChanging()
C#
protected override void OnPreviewKeyDown(KeyEventArgs e)
Parameters:eKeyEventArgs

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

C#
public abstract void RecreateUI()

Implements: IDocumentEditorPresenter.RecreateUI()

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

C#
public void ScrollToHorizontalOffset(double offset)
Parameters:offsetdouble

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

Implements: IDocumentEditorPresenter.ScrollToHorizontalOffset(double)

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

C#
public abstract void ScrollToNote(Note note)
Parameters:noteNote

The note to which the document view will scroll.

Implements: IDocumentEditorPresenter.ScrollToNote(Note)

Scrolls the document to the specified vertical offset.

C#
public void ScrollToVerticalOffset(double offset)
Parameters:offsetdouble

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

Implements: IDocumentEditorPresenter.ScrollToVerticalOffset(double)

C#
protected abstract void SetCaretBlinking(bool isBlinking)
Parameters:isBlinkingbool

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

C#
public abstract void ShowCaret()

Implements: IDocumentEditorPresenter.ShowCaret()

Displays a drop marker at the specified document position.

C#
public void ShowDropMarker(DocumentPosition position)
Parameters:positionDocumentPosition

The document position where the drop marker should be shown.

Implements: IDocumentEditorPresenter.ShowDropMarker(DocumentPosition)

Updates the properties of the caret within the document presenter.

C#
public abstract void UpdateCaretProperties()

Implements: IDocumentEditorPresenter.UpdateCaretProperties()

Updates the size of the caret in the Document Presenter.

C#
public abstract void UpdateCaretSize()

Implements: IDocumentEditorPresenter.UpdateCaretSize()

C#
protected void UpdateCurrentVisiblePage(int newValue)
Parameters:newValueint

Updates the proofing text decoration for the document presenter.

C#
public abstract void UpdateProofingTextDecoration()

Implements: IDocumentEditorPresenter.UpdateProofingTextDecoration()

Remarks:

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

C#
protected static void UpdateScrollBar(double viewportSize, double max, ScrollBar scrollBar, ScrollBarVisibility suggestedVisibility)
Parameters:viewportSizedoublemaxdoublescrollBarScrollBarsuggestedVisibilityScrollBarVisibility

Updates the scroll offset based on the specified document position.

C#
public abstract void UpdateScrollOffsetFromDocumentPosition(DocumentPosition position)
Parameters:positionDocumentPosition

The document position to use for updating the scroll offset.

Implements: IDocumentEditorPresenter.UpdateScrollOffsetFromDocumentPosition(DocumentPosition)