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