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:
public abstract class DocumentPresenterBase : ContentControl, IDocumentEditorPresenter
Inheritance: objectDocumentPresenterBase
Derived Classes:
Implements:
Constructors
public DocumentPresenterBase()
Fields
protected static readonly double DragMargin
Properties
protected DocumentPosition CaretPosition { get; }
Gets the horizontal scroll position.
public double HorizontalOffset { get; }
Implements:
protected double HorizontalScrollOffset { get; set; }
Gets a value indicating whether the document presenter is currently focused.
public abstract bool IsFocused { get; }
Implements:
Gets or set the current selection handler.
public KeyboardSelectionHandler KeyboardSelectionHandler { get; set; }
Gets or sets the current selection handler.
public MouseSelectionHandler MouseSelectionHandler { get; set; }
Gets or sets the owner of the DocumentPresenterBase instance.
public RadRichTextBox Owner { get; set; }
The owner associated with the DocumentPresenterBase instance.
Implements:
ScaleFactor
Size
Gets or sets the scale factor of the document presenter.
Gets the height that is scrollable within the document presenter.
public abstract double ScrollableHeight { get; }
Implements:
Gets the scrollable width of the document presenter.
public abstract double ScrollableWidth { get; }
Implements:
Gets the vertical scroll position.
public double VerticalOffset { get; }
Implements:
protected double VerticalScrollOffset { get; set; }
Gets or sets the height of the viewport used by the document presenter.
public double ViewportHeight { get; }
A double representing the height of the viewport in pixels.
Implements:
Gets or sets the width of the viewport in the document presenter.
public double ViewportWidth { get; }
A double representing the width of the viewport.
Implements:
Methods
Executes the actions that should occur when the document is changed.
public virtual void DoOnDocumentChanged()
Implements:
Executes actions that need to occur when the document is about to change.
public virtual void DoOnDocumentChanging()
Implements:
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.
public abstract void FocusCaret()
Implements:
Retrieves the currently displayed page in the document presenter.
public abstract int GetCurrentPage()
The current page as an instance of type T, representing the content being displayed.
protected abstract Rect GetCurrentSectionBoundsInViewOverride()
Rect
Converts the specified viewpoint in the document presenter to a document point.
public abstract Point GetDocumentPointFromViewPoint(Point viewPoint)
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:
Retrieves the document position corresponding to the specified view point.
public abstract DocumentPosition GetDocumentPositionFromViewPoint(Point viewPoint)
The point in the view for which the document position is to be determined.
Returns:A DocumentPosition representing the document position associated with the specified view point.
Implements:
Retrieves the viewpoint associated with a specified document position.
public abstract Point GetViewPointFromDocumentPosition(DocumentPosition position)
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:
Handles the Page Down key event, allowing for navigation through document pages.
public abstract void HandlePageDown()
Implements:
Handles the Page Up key press event, allowing navigation to the previous page in the document view.
public abstract void HandlePageUp()
Implements:
Hides the caret in the document presenter, making it invisible to the user.
public abstract void HideCaret()
Implements:
Hides the drop marker in the document presenter.
public void HideDropMarker()
Implements:
protected void InvalidateAndUpdateLayout()
protected void InvalidateLayout()
Invalidates the arrangement of the document presenter, causing it to re-evaluate its layout.
public void InvalidatePresenterArrange()
Implements:
This method is typically called when the content of the document changes, or when the layout needs to be refreshed.
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.
public void InvalidatePresenterMeasure()
Implements:
protected virtual void InvalidatePresenterMeasureOverride()
Moves the drop marker to the specified document position.
public void MoveDropMarker(DocumentPosition documentPosition)
The document position where the drop marker should be moved.
Implements:
protected override void OnGotFocus(RoutedEventArgs e)
protected override void OnKeyUp(KeyEventArgs e)
protected override void OnLostFocus(RoutedEventArgs e)
protected virtual void OnOwnerChanged()
protected virtual void OnOwnerChanging()
protected override void OnPreviewKeyDown(KeyEventArgs e)
Recreates the user interface of the document presenter. This method is typically called to refresh the UI when the underlying document changes.
public abstract void RecreateUI()
Implements:
Scrolls the content of the document horizontally to the specified offset.
public void ScrollToHorizontalOffset(double offset)
The horizontal offset to scroll to, expressed in device-independent units.
Implements:
Scrolls the document view to the specified note, bringing it into view.
public abstract void ScrollToNote(Note note)
The note to which the document view will scroll.
Implements:
Scrolls the document to the specified vertical offset.
public void ScrollToVerticalOffset(double offset)
The vertical offset to scroll to, in device-independent units.
Implements:
Displays the caret at the current position in the document presenter.
public abstract void ShowCaret()
Implements:
Displays a drop marker at the specified document position.
public void ShowDropMarker(DocumentPosition position)
The document position where the drop marker should be shown.
Implements:
Updates the properties of the caret within the document presenter.
public abstract void UpdateCaretProperties()
Implements:
Updates the size of the caret in the Document Presenter.
public abstract void UpdateCaretSize()
Implements:
Updates the proofing text decoration for the document presenter.
public abstract void UpdateProofingTextDecoration()
Implements:
This method applies any necessary decorations to the text based on the current proofing status.
Updates the scroll offset based on the specified document position.
public abstract void UpdateScrollOffsetFromDocumentPosition(DocumentPosition position)
The document position to use for updating the scroll offset.
Implements: