[]
        
(Showing Draft Content)

C1.WPF.RichTextBox.C1RichTextBox

C1RichTextBox Class

Powerful rich text editor that allows you to load, edit, and save formatted text as HTML documents.

Namespace: C1.WPF.RichTextBox
Assembly: C1.WPF.RichTextBox.4.6.2.dll
Syntax
[TemplatePart(Name = "Content", Type = typeof(Grid))]
[TemplatePart(Name = "Root", Type = typeof(Panel))]
[TemplatePart(Name = "HorizontalScrollBar", Type = typeof(ScrollBar))]
[TemplatePart(Name = "VerticalScrollBar", Type = typeof(ScrollBar))]
[TemplatePart(Name = "ScrollBars", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "Watermark", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "Container", Type = typeof(Grid))]
[TemplateVisualState(Name = "ReadOnly", GroupName = "WritableStates")]
[TemplateVisualState(Name = "Writable", GroupName = "WritableStates")]
[TemplateVisualState(Name = "MouseOver", GroupName = "CommonStates")]
[TemplateVisualState(Name = "Disabled", GroupName = "CommonStates")]
[TemplateVisualState(Name = "Normal", GroupName = "CommonStates")]
[TemplateVisualState(Name = "Focused", GroupName = "FocusStates")]
[TemplateVisualState(Name = "Unfocused", GroupName = "FocusStates")]
[TemplateVisualState(Name = "Valid", GroupName = "ValidationStatesStates")]
[TemplateVisualState(Name = "InvalidUnfocused", GroupName = "ValidationStatesStates")]
[TemplateVisualState(Name = "InvalidFocused", GroupName = "ValidationStatesStates")]
[StyleTypedProperty(Property = "ScrollBarStyle", StyleTargetType = typeof(ScrollBar))]
[StyleTypedProperty(Property = "ValidationDecoratorStyle", StyleTargetType = typeof(C1ValidationDecorator))]
public class C1RichTextBox : Control, IAnimatable, IFrameworkInputElement, IInputElement, IQueryAmbient, ISupportInitialize

Constructors

Name Description
C1RichTextBox()

Initializes a new instance of a C1RichTextBox.

Fields

Name Description
AcceptsReturnProperty

Identifies the AcceptsReturn dependency property.

AcceptsTabProperty

Identifies the AcceptsTab dependency property.

AutoCapitalizationModeProperty

Identifies the AutoCapitalizationMode dependency property.

AutoFormatHyperlinksProperty

Identifies the AutoFormatHyperlinks dependency property.

CaretBrushProperty

Identifies the CaretBrush dependency property.

ComputedHorizontalScrollBarVisibilityProperty

Identifies the ComputedHorizontalScrollBarVisibility dependency property.

ComputedVerticalScrollBarVisibilityProperty

Identifies the ComputedVerticalScrollBarVisibility dependency property.

DefaultParagraphMarginProperty

Identifies the DefaultParagraphMargin dependency property.

DisableSelectionProperty

Identifies the DisableSelection dependency property.

DisabledCuesVisibilityProperty

Identifies the DisabledCuesVisibility dependency property.

DocumentProperty

Identifies the Document dependency property.

ExtentHeightProperty

Identifies the ExtentHeight dependency property.

ExtentWidthProperty

Identifies the ExtentWidth dependency property.

FocusCuesVisibilityProperty

Identifies the FocusCuesVisibility dependency property.

HideCaretProperty

Identifies the HideCaret dependency property.

HideSelectionProperty

Identifies the HideSelection dependency property.

HorizontalOffsetProperty

Identifies the HorizontalOffset dependency property.

HorizontalScrollBarVisibilityProperty

Identifies the HorizontalScrollBarVisibility dependency property.

HtmlFilterProperty

Identifies the HtmlFilter dependency property.

HtmlProperty

Identifies the Html dependency property.

IsEnabledSpellCheckerProperty

Identifies the IsEnabledSpellChecker dependency property.

IsFocusedProperty

Identifies the IsFocused dependency property.

IsReadOnlyProperty

Identifies the IsReadOnly dependency property.

LineNumberModeProperty

Identifies the LineNumberMode dependency property.

PageCountProperty

Identifies the PageCount dependency property.

PageNumberProperty

Identifies the PageNumber dependency property.

PrintPageLayoutProperty

Identifies the PrintPageLayout dependency property.

PrintPanelTemplateProperty

Identifies the PrintPanelTemplate dependency property.

PrintTemplateProperty

Identifies the PrintTemplate dependency property.

ReturnModeProperty

Identifies the ReturnMode dependency property.

ScrollBarStyleProperty

Identifies the ScrollBarStyle dependency property.

ScrollableHeightProperty

Identifies the ScrollableHeight dependency property.

ScrollableWidthProperty

Identifies the ScrollableWidth dependency property.

SelectionBackgroundProperty

Identifies the SelectionBackground dependency property.

SelectionForegroundProperty

Identifies the SelectionForeground dependency property.

TabSizeProperty

Identifies the TabSize dependency property.

TextProperty

Identifies the Text dependency property.

TextWrappingProperty

Identifies the TextWrapping dependency property.

UIContainerResizeTemplateProperty

Identifies the UIContainerResizeTemplate dependency property.

ValidationDecoratorStyleProperty

Identifies the ValidationDecoratorStyle dependency property.

VerticalOffsetProperty

Identifies the VerticalOffset dependency property.

VerticalScrollBarVisibilityProperty

Identifies the VerticalScrollBarVisibility dependency property.

ViewModeProperty

Identifies the ViewMode dependency property.

ViewportHeightProperty

Identifies the ViewportHeight dependency property.

ViewportWidthProperty

Identifies the ViewportWidth dependency property.

WatermarkProperty

Identifies the Watermark dependency property.

ZoomProperty

Identifies the Zoom dependency property.

Properties

Name Description
AcceptsReturn

Gets or sets a value that indicates how the text editing control responds when the user presses the ENTER key.

AcceptsTab

Gets or sets whether tabs are accepted.

AutoCapitalizationMode

Gets or sets a value of AutoCapitalizationMode that indicates how the C1RichTextBox handles the auto capitalization.

Gets or sets a value that indicates whether url strings would be converted to hyperlink when the user presses the ENTER or SPACE key.

CaretBrush

Gets or sets the brush of blinking cursor of the C1RichTextBox.

ClipboardMode

Indicates how the C1RichTextBox uses the clipboard.

ComputedHorizontalScrollBarVisibility

Gets a value that indicates whether the horizontal ScrollBar is visible.

ComputedVerticalScrollBarVisibility

Gets a value that indicates whether the vertical ScrollBar is visible.

DefaultParagraphMargin

Gets or sets the default outer margin of a C1Paragraph element.

DisableSelection

Gets or sets whether text selection is disabled.

DisabledCuesVisibility

Gets or sets a value indicating whether the disabled visuals of the control are visible.

Document

Gets or sets the C1Document for the C1RichTextBox.

DocumentHistory

Gets the DocumentHistory associated with current Document, used for undoing and redoing actions.

ExtentHeight

Gets the vertical size of all the content for display in the C1RichTextBox.

ExtentWidth

Gets the horizontal size of all the content for display in the C1RichTextBox.

FocusCuesVisibility

Gets or sets a value indicating whether the focus visuals of the control are visible.

HideCaret

Gets or sets whether the caret is hidden.

HideSelection

Gets or sets whether the control should highlight the selection when not in focus.

HorizontalOffset

Gets or sets a value that indicates the horizontal offset of the scrolled content.

HorizontalScrollBarVisibility

Gets or sets a value that indicates whether a horizontal ScrollBar should be displayed.

Html

Gets or sets the content of the C1RichTextBox in HTML format.

HtmlFilter

Gets or sets the HtmlFilter used by this C1RichTextBox to serialize and deserialize from HTML.

IsEnabledSpellChecker

Gets or sets a value indicating whether the C1SpellChecker is enabled.

IsFocused

Returns true if the control has the focus.

IsReadOnly

Gets or sets whether the user is allowed to modify the text in the control.

LineNumberMode

Gets or sets the LineNumberMode of the C1RichTextBox.

NavigationMode

Indicates when the RequestNavigate event is fired.

PageCount

Gets the current number of display pages for the content hosted by the C1RichTextBox.

PageNumber

Gets the page number for the currently displayed page.

Painters

Gets the collection of IRichTextPainter associated with this C1RichTextBox.

PrintPageLayout

Gets or sets the layout used for the pages when ViewMode is Print.

PrintPanelTemplate

Gets or sets the ItemsPanelTemplate used for the panel containing the pages in print view mode.

PrintTemplate

Gets or sets the DataTemplate used to present the C1RichTextBox in print mode.

ReturnMode

Gets or sets a value of ReturnMode that indicates how the C1RichTextBox handles the Return key.

ScrollBarStyle

Gets or sets the Style used by the two ScrollBar controls contained in the default template.

ScrollableHeight

Gets a value that represents the horizontal size of the area that can be scrolled. The difference between the height of the extent and the height of the viewport.

ScrollableWidth

Gets a value that represents the vertical size of the area that can be scrolled. The difference between the width of the extent and the width of the viewport.

SelectedText

Gets or sets the content of the current selection in the rich text box.

Selection

Gets or sets the C1TextRange selected in the C1RichTextBox's document.

SelectionBackground

Gets or sets the brush used to fill the background of the selected text.

SelectionForeground

Gets or sets the brush used to fill the foreground of the selected text.

SelectionLength

Gets or sets the number of characters in the current selection in the rich text box.

SelectionStart

Gets or sets the starting position of the text selected in the rich text box.

SpellChecker

Gets or sets the C1.WPF.ISpellChecker used for as-you-type spell checking.

StyleOverrides

Gets the collection of IStyleOverride associated with this C1RichTextBox.

TabSize

Gets or sets the size of a tab character in spaces.

Text

Gets or sets the text inside the C1Document of the C1RichTextBox.

TextWrapping

Gets or sets whether the control should wrap the text to fit its width.

UIContainerResizeTemplate

Gets or sets the DataTemplate that generates the thumbs for resizing C1InlineUIContainers.

ValidationDecoratorStyle

Gets or sets the style that is applied to the inner C1.WPF.C1ValidationDecorator.

VerticalOffset

Gets or sets a value that indicates the vertical offset of the scrolled content.

VerticalScrollBarVisibility

Gets or sets a value that indicates whether a horizontal ScrollBar should be displayed.

ViewManager

Gets the C1RichTextViewManager currently used by this C1RichTextBox.

ViewMode

Gets or sets the TextViewMode of the C1RichTextBox.

ViewportHeight

Gets a value that contains the vertical size of the viewable content.

ViewportWidth

Gets a value that contains the horizontal size of the viewable content.

Watermark

Gets or sets the content of the watermark.

Zoom

Gets or sets a zoom value applied to the contents of the C1RichTextBox.

Methods

Name Description
BeginInit()
ChangeVisualStateCommon(bool)

Updates the current visual state of the Common visual state group to match the object's properties.

ChangeVisualStateFocus(bool)

Updates the current visual state of the Focus visual state group to match the object's properties.

ChangeVisualStateWritable(bool)

Updates the current visual state of the Writable visual state group to match the object's properties.

ClipboardCopy()

Copies the selection to the clipboard.

ClipboardCut()

Cuts the selection to the clipboard.

ClipboardPaste()

Pastes the current content of the clipboard.

DeleteSelection()
EndInit()
Focus()

Attempts to set the focus on the control.

FormatCopy()

Copies the format of the current selection to the format clipboard.

FormatPaste()

Applies the content of the format clipboard to the current selection.

GetElementFromPoint(Point)

Returns the C1TextElement directly below a given point.

GetHtml(HtmlEncoding)

Get the HTML content with the selected encoding.

GetPositionFromPoint(Point)

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

GetRectFromPosition(C1TextPointer)

Returns the Rect of screen coordinates for a given position.

GetTextRange(int, int)

Gets a C1TextRange that represents a range in the current Document.

GoToPage(int)

Causes the editor to jump to a specified page number.

OnApplyTemplate()

Builds the visual tree for the C1RichTextBox control when a new template is applied.

OnDragEnter(DragEventArgs)
OnDragLeave(DragEventArgs)
OnDragOver(DragEventArgs)
OnDrop(DragEventArgs)
OnGiveFeedback(GiveFeedbackEventArgs)
OnKeyDown(KeyEventArgs)
OnKeyUp(KeyEventArgs)
OnPropertyChanged(DependencyPropertyChangedEventArgs)

Invoked whenever the effective value of any dependency property has been updated.

OnQueryContinueDrag(QueryContinueDragEventArgs)
RemoveShortcut(ModifierKeys, Key)

Remove the shortcut for some action.

ScrollIntoView(C1TextElement)

Scrolls the C1RichTextBox to bring a C1TextElement into view.

ScrollIntoView(C1TextPointer)

Scrolls the C1RichTextBox to bring a C1TextPointer into view.

ScrollTo(C1TextPointer)

Scrolls the C1RichTextBox so that the given position is at the top.

Select(int, int)

Selects a range of text in the rich text box.

SelectAll()

Selects all the text in the control.

SetHtml(string, Uri)

Sets the HTML content.

Events

Name Description
ClipboardCopying

Fired when a clipboard copy has been triggered.

ClipboardPasting

Fired when a clipboard paste has been triggered.

DocumentChanged

Fires when the Document property changes.

ElementMouseEnter

Fires when the mouse enters a text element.

ElementMouseLeave

Fires when the mouse leaves a text element.

ElementMouseLeftButtonDown

Fires when the tapped a text element.

ElementMouseLeftButtonUp

Fires when the left mouse button is released over a text element.

ElementMouseMove

Fires when the mouse moves over a text element.

IsMouseOverChanged

Event raised when the IsMouseOver property has changed.

KeyDown

Occurs when a keyboard key is pressed while the C1RichTextBox has focus.

LineNumberModeChanged

Event raised when the LineNumberMode property has changed.

MouseLeftButtonDown

Occurs when the left mouse button is pressed (or when the tip of the stylus touches the tablet PC) while the mouse pointer is over a UIElement.

MouseSelectionCompleted

Fired when the user completes a selection using a mouse.

RequestNavigate

Fires when the user clicks on a C1Hyperlink.

SelectionChanged

Fires when Selection changes.

TextChanged

Fired when there is a change in the document.

TextDragMove

Fires when the mouse moves while dragging text.

TextDragStart

Fires when text dragging starts. Allows canceling the drag.

TextDrop

Fires when dragged text is dropped.

ViewModeChanged

Event raised when the ViewMode property has changed.