Edit

Share via


MarkdownTextBlock Class

Definition

An efficient and extensible control that can parse and render markdown.

public class MarkdownTextBlock : Windows.UI.Xaml.Controls.Control, Microsoft.Toolkit.Uwp.UI.Controls.Markdown.Render.ICodeBlockResolver, Microsoft.Toolkit.Uwp.UI.Controls.Markdown.Render.IImageResolver, Microsoft.Toolkit.Uwp.UI.Controls.Markdown.Render.ILinkRegister
type MarkdownTextBlock = class
    inherit Control
    interface ILinkRegister
    interface IImageResolver
    interface ICodeBlockResolver
Public Class MarkdownTextBlock
Inherits Control
Implements ICodeBlockResolver, IImageResolver, ILinkRegister
Inheritance
Windows.UI.Xaml.Controls.Control
MarkdownTextBlock
Implements

Constructors

MarkdownTextBlock()

Initializes a new instance of the MarkdownTextBlock class.

Fields

CodeBackgroundProperty

Gets the dependency property for CodeBackground.

CodeBorderBrushProperty

Gets the dependency property for CodeBorderBrush.

CodeBorderThicknessProperty

Gets the dependency property for CodeBorderThickness.

CodeFontFamilyProperty

Gets the dependency property for CodeFontFamily.

CodeForegroundProperty

Gets the dependency property for CodeForeground.

CodeMarginProperty

Gets the dependency property for CodeMargin.

CodePaddingProperty

Gets the dependency property for CodePadding.

CodeStylingProperty

Gets the dependency property for CodeStyling.

EmojiFontFamilyProperty

Gets the dependency property for EmojiFontFamily.

Header1FontSizeProperty

Gets the dependency property for Header1FontSize.

Header1FontWeightProperty

Gets the dependency property for Header1FontWeight.

Header1ForegroundProperty

Gets the dependency property for Header1Foreground.

Header1MarginProperty

Gets the dependency property for Header1Margin.

Header2FontSizeProperty

Gets the dependency property for Header2FontSize.

Header2FontWeightProperty

Gets the dependency property for Header2FontWeight.

Header2ForegroundProperty

Gets the dependency property for Header2Foreground.

Header2MarginProperty

Gets the dependency property for Header2Margin.

Header3FontSizeProperty

Gets the dependency property for Header3FontSize.

Header3FontWeightProperty

Gets the dependency property for Header3FontWeight.

Header3ForegroundProperty

Gets the dependency property for Header3Foreground.

Header3MarginProperty

Gets the dependency property for Header3Margin.

Header4FontSizeProperty

Gets the dependency property for Header4FontSize.

Header4FontWeightProperty

Gets the dependency property for Header4FontWeight.

Header4ForegroundProperty

Gets the dependency property for Header4Foreground.

Header4MarginProperty

Gets the dependency property for Header4Margin.

Header5FontSizeProperty

Gets the dependency property for Header5FontSize.

Header5FontWeightProperty

Gets the dependency property for Header5FontWeight.

Header5ForegroundProperty

Gets the dependency property for Header5Foreground.

Header5MarginProperty

Gets the dependency property for Header5Margin.

Header6FontSizeProperty

Gets the dependency property for Header6FontSize.

Header6FontWeightProperty

Gets the dependency property for Header6FontWeight.

Header6ForegroundProperty

Gets the dependency property for Header6Foreground.

Header6MarginProperty

Gets the dependency property for Header6Margin.

HorizontalRuleBrushProperty

Gets the dependency property for HorizontalRuleBrush.

HorizontalRuleMarginProperty

Gets the dependency property for HorizontalRuleMargin.

HorizontalRuleThicknessProperty

Gets the dependency property for HorizontalRuleThickness.

ImageMaxHeightProperty

Gets the dependency property for ImageMaxHeight

ImageMaxWidthProperty

Gets the dependency property for ImageMaxWidth

ImageStretchProperty

Gets the dependency property for ImageStretch.

InlineCodeBackgroundProperty

Gets the dependency property for InlineCodeBackground.

InlineCodeBorderBrushProperty

Gets the dependency property for InlineCodeBorderBrush.

InlineCodeBorderThicknessProperty

Gets the dependency property for InlineCodeBorderThickness.

InlineCodeFontFamilyProperty

Gets the dependency property for InlineCodeFontFamily.

InlineCodeForegroundProperty

Gets the dependency property for InlineCodeForeground.

InlineCodeMarginProperty

Gets the dependency property for InlineCodeMargin.

InlineCodePaddingProperty

Gets the dependency property for InlineCodePadding.

IsTextSelectionEnabledProperty

Gets the dependency property for IsTextSelectionEnabled.

LinkForegroundProperty

Gets the dependency property for LinkForeground.

ListBulletSpacingProperty

Gets the dependency property for ListBulletSpacing.

ListGutterWidthProperty

Gets the dependency property for ListGutterWidth.

ListMarginProperty

Gets the dependency property for ListMargin.

ParagraphLineHeightProperty

Gets the dependency property for ParagraphLineHeight.

ParagraphMarginProperty

Gets the dependency property for ParagraphMargin.

QuoteBackgroundProperty

Gets the dependency property for QuoteBackground.

QuoteBorderBrushProperty

Gets the dependency property for QuoteBorderBrush.

QuoteBorderThicknessProperty

Gets the dependency property for QuoteBorderThickness.

QuoteForegroundProperty

Gets the dependency property for QuoteForeground.

QuoteMarginProperty

Gets the dependency property for QuoteMargin.

QuotePaddingProperty

Gets the dependency property for QuotePadding.

SchemeListProperty

Gets the dependency property for UriPrefix.

TableBorderBrushProperty

Gets the dependency property for TableBorderBrush.

TableBorderThicknessProperty

Gets the dependency property for TableBorderThickness.

TableCellPaddingProperty

Gets the dependency property for TableCellPadding.

TableMarginProperty

Gets the dependency property for TableMargin.

TextProperty

Gets the dependency property for Text.

TextWrappingProperty

Gets the dependency property for TextWrapping.

UriPrefixProperty

Gets the dependency property for UriPrefix.

UseSyntaxHighlightingProperty

Gets the dependency property for UseSyntaxHighlighting.

WrapCodeBlockProperty

Gets the dependency property for WrapCodeBlock.

YamlBorderBrushProperty

Gets the dependency property for YamlBorderBrush.

YamlBorderThicknessProperty

Gets the dependency property for YamlBorderThickness.

Properties

CodeBackground

Gets or sets the brush used to fill the background of a code block.

CodeBorderBrush

Gets or sets the brush used to render the border fill of a code block.

CodeBorderThickness

Gets or sets the thickness of the border around code blocks.

CodeFontFamily

Gets or sets the font used to display code. If this is null, then Windows.UI.Xaml.Media.FontFamily is used.

CodeForeground

Gets or sets the brush used to render the text inside a code block. If this is null, then Foreground is used.

CodeMargin

Gets or sets the space between the code border and the text.

CodePadding

Gets or sets space between the code border and the text.

CodeStyling

Gets or sets the Default Code Styling for Code Blocks.

EmojiFontFamily

Gets or sets the font used to display emojis. If this is null, then Segoe UI Emoji font is used.

Header1FontSize

Gets or sets the font size for level 1 headers.

Header1FontWeight

Gets or sets the font weight to use for level 1 headers.

Header1Foreground

Gets or sets the foreground brush for level 1 headers.

Header1Margin

Gets or sets the margin for level 1 headers.

Header2FontSize

Gets or sets the font size for level 2 headers.

Header2FontWeight

Gets or sets the font weight to use for level 2 headers.

Header2Foreground

Gets or sets the foreground brush for level 2 headers.

Header2Margin

Gets or sets the margin for level 2 headers.

Header3FontSize

Gets or sets the font size for level 3 headers.

Header3FontWeight

Gets or sets the font weight to use for level 3 headers.

Header3Foreground

Gets or sets the foreground brush for level 3 headers.

Header3Margin

Gets or sets the margin for level 3 headers.

Header4FontSize

Gets or sets the font size for level 4 headers.

Header4FontWeight

Gets or sets the font weight to use for level 4 headers.

Header4Foreground

Gets or sets the foreground brush for level 4 headers.

Header4Margin

Gets or sets the margin for level 4 headers.

Header5FontSize

Gets or sets the font size for level 5 headers.

Header5FontWeight

Gets or sets the font weight to use for level 5 headers.

Header5Foreground

Gets or sets the foreground brush for level 5 headers.

Header5Margin

Gets or sets the margin for level 5 headers.

Header6FontSize

Gets or sets the font size for level 6 headers.

Header6FontWeight

Gets or sets the font weight to use for level 6 headers.

Header6Foreground

Gets or sets the foreground brush for level 6 headers.

Header6Margin

Gets or sets the margin for level 6 headers.

HorizontalRuleBrush

Gets or sets the brush used to render a horizontal rule. If this is null, then HorizontalRuleBrush is used.

HorizontalRuleMargin

Gets or sets the margin used for horizontal rules.

HorizontalRuleThickness

Gets or sets the vertical thickness of the horizontal rule.

ImageMaxHeight

Gets or sets the MaxHeight for images.

ImageMaxWidth

Gets or sets the MaxWidth for images.

ImageStretch

Gets or sets the stretch used for images.

InlineCodeBackground

Gets or sets the background brush for inline code.

InlineCodeBorderBrush

Gets or sets the border brush for inline code.

InlineCodeBorderThickness

Gets or sets the thickness of the border for inline code.

InlineCodeFontFamily

Gets or sets the font used to display code. If this is null, then Windows.UI.Xaml.Media.FontFamily is used.

InlineCodeForeground

Gets or sets the foreground brush for inline code.

InlineCodeMargin

Gets or sets the margin for inline code.

InlineCodePadding

Gets or sets the space between the code border and the text.

IsTextSelectionEnabled

Gets or sets a value indicating whether text selection is enabled.

LinkForeground

Gets or sets the brush used to render links. If this is null, then Foreground is used.

ListBulletSpacing

Gets or sets the space between the list item bullets/numbers and the list item content.

ListGutterWidth

Gets or sets the width of the space used by list item bullets/numbers.

ListMargin

Gets or sets the margin used by lists.

ParagraphLineHeight

Gets or sets the line hegiht used for paragraphs.

ParagraphMargin

Gets or sets the margin used for paragraphs.

QuoteBackground

Gets or sets the brush used to fill the background of a quote block.

QuoteBorderBrush

Gets or sets the brush used to render a quote border. If this is null, then QuoteBorderBrush is used.

QuoteBorderThickness

Gets or sets the thickness of quote borders.

QuoteForeground

Gets or sets the brush used to render the text inside a quote block. If this is null, then Foreground is used.

QuoteMargin

Gets or sets the space outside of quote borders.

QuotePadding

Gets or sets the space between the quote border and the text.

SchemeList

Gets or sets the SchemeList.

TableBorderBrush

Gets or sets the brush used to render table borders. If this is null, then TableBorderBrush is used.

TableBorderThickness

Gets or sets the thickness of any table borders.

TableCellPadding

Gets or sets the padding inside each cell.

TableMargin

Gets or sets the margin used by tables.

Text

Gets or sets the markdown text to display.

TextWrapping

Gets or sets the word wrapping behavior.

UriPrefix

Gets or sets the Prefix of Uri.

UseSyntaxHighlighting

Gets or sets a value indicating whether to use Syntax Highlighting on Code.

WrapCodeBlock

Gets or sets a value indicating whether to Wrap the Code Block or use a Horizontal Scroll.

YamlBorderBrush

Gets or sets the brush used to render yaml borders. If this is null, then TableBorderBrush is used.

YamlBorderThickness

Gets or sets the thickness of any yaml header borders.

Methods

OnApplyTemplate() Windows.UI.Xaml.Controls.Control.OnApplyTemplate
RegisterNewHyperLink(Hyperlink, String)

Called when the render has a link we need to listen to.

RegisterNewHyperLink(Image, String, Boolean)

Called when the render has a link we need to listen to.

SetRenderer<T>()

Sets the Markdown Renderer for Rendering the UI.

Events

CodeBlockResolving

Fired when a Code Block is being Rendered. The default implementation is to output the CodeBlock as Plain Text.

You must set Handled to true in order to process your changes.
ImageClicked

Fired when an image element in the markdown was tapped.

ImageResolving

Fired when an image from the markdown document needs to be resolved. The default implementation is basically new BitmapImage(new Uri(e.Url));.

You must set Handled to true in order to process your changes.
LinkClicked

Fired when a link element in the markdown was tapped.

MarkdownRendered

Fired when the text is done parsing and formatting. Fires each time the markdown is rendered.

Explicit Interface Implementations

ICodeBlockResolver.ParseSyntax(InlineCollection, String, String)

Called when a Code Block is being rendered.

IImageResolver.ResolveImageAsync(String, String)

Called when the renderer needs to display a image.

Applies to