Formatting service
Apply character and paragraph formatting to the current editor selection. Use these operations for application-owned formatting controls.
The facade is available as editor.Formatting; its interface can be replaced by an application implementation.

Use it in your application
Formatting requires an appropriate editable selection or caret. Source mode supports the documented literal wrapping and insertion adaptations; it is not a hidden Design selection.
All examples assume an editor named editor, already attached to a visible window, and an awaited editor.Ready. Keep operations asynchronous instead of blocking the UI thread.
await editor.Formatting.BoldAsync();
await editor.Formatting.ChangeFontSizeAsync("12pt");Members
These signatures come from the delivered 1.0.2 assemblies and XML documentation. Cancellation tokens can be supplied to awaited operations. Follow the source-specific notes above when adapting a WPF integration.
| Member | Signature |
|---|---|
AlignCenterAsync | Task AlignCenterAsync(CancellationToken cancellationToken) |
AlignLeftAsync | Task AlignLeftAsync(CancellationToken cancellationToken) |
AlignRightAsync | Task AlignRightAsync(CancellationToken cancellationToken) |
ApplyListAsync | Task ApplyListAsync(ListTypes listType, FormatOptions option, CancellationToken cancellationToken) |
ApplyTitleHeaderAsync | Task ApplyTitleHeaderAsync(int headerNumber, CancellationToken cancellationToken) |
BoldAsync | Task BoldAsync(FormatOptions option, CancellationToken cancellationToken) |
ChangeFontAsync | Task ChangeFontAsync(string fontFamilyName, string fontSize, Color foreColor, CancellationToken cancellationToken) |
ChangeFontNameAsync | Task ChangeFontNameAsync(string fontFamilyName, CancellationToken cancellationToken) |
ChangeFontSizeAsync | Task ChangeFontSizeAsync(string fontSize, CancellationToken cancellationToken) |
ChangeForeColorAsync | Task ChangeForeColorAsync(Color foreColor, CancellationToken cancellationToken) |
ChangeHighlightColorAsync | Task ChangeHighlightColorAsync(Color highlightColor, CancellationToken cancellationToken) |
IndentAsync | Task IndentAsync(CancellationToken cancellationToken) |
ItalicAsync | Task ItalicAsync(FormatOptions option, CancellationToken cancellationToken) |
OutdentAsync | Task OutdentAsync(CancellationToken cancellationToken) |
RemoveAlignmentAsync | Task RemoveAlignmentAsync(CancellationToken cancellationToken) |
RemoveFormatAllAsync | Task RemoveFormatAllAsync(CancellationToken cancellationToken) |
RemoveFormatFromSelectionAsync | Task RemoveFormatFromSelectionAsync(CancellationToken cancellationToken) |
RemoveHeaderTitleAsync | Task RemoveHeaderTitleAsync(CancellationToken cancellationToken) |
StrikeThroughAsync | Task StrikeThroughAsync(FormatOptions option, CancellationToken cancellationToken) |
SubscriptAsync | Task SubscriptAsync(FormatOptions option, CancellationToken cancellationToken) |
SuperscriptAsync | Task SuperscriptAsync(FormatOptions option, CancellationToken cancellationToken) |
UnderlineAsync | Task UnderlineAsync(FormatOptions option, CancellationToken cancellationToken) |