Skip to main content

MarkdownImage Class

Definition

Assembly:Avalonia.Controls.Markdown
Package:Avalonia.Controls.Markdown

A Avalonia.Controls.Documents.RichInlineUIContainer that represents an image in a Markdown document. Carries the image URL and title so the render layer can load the image when an Avalonia.Controls.Documents.MarkdownImage.ImageLoader is available.

public class MarkdownImage

Inheritance: RichInlineUIContainer -> MarkdownImage

Remarks

The Avalonia.Controls.Documents.MarkdownImage.ImageLoader is typically set via an Avalonia style, mirroring how Avalonia.Controls.Documents.MarkdownCodeBlock.Highlighter is configured:

<Style Selector="MarkdownImage">
<Setter Property="ImageLoader" Value="{StaticResource myLoader}"/>
</Style>

Image loading is deferred until both Avalonia.Controls.Documents.MarkdownImage.ImageSource and Avalonia.Controls.Documents.MarkdownImage.ImageLoader are available. This avoids coupling the snapshot renderer to the image loader.

Constructors

NameDescription
MarkdownImageNo summary available.

MarkdownImage Constructor

public MarkdownImage()

Properties

NameDescription
ImageLoaderGets or sets the image loader used to resolve the image URL.
ImageSourceGets or sets the image URL.
ImageTitleGets or sets the image title (used as tooltip).

ImageLoader Property

Gets or sets the image loader used to resolve the image URL.

public Avalonia.Controls.MarkdownImageLoader ImageLoader { get; set; }

ImageSource Property

Gets or sets the image URL.

public string ImageSource { get; set; }

ImageTitle Property

Gets or sets the image title (used as tooltip).

public string ImageTitle { get; set; }

Fields

ImageLoaderProperty Field

Defines the Avalonia.Controls.Documents.MarkdownImage.ImageLoader property.

public Avalonia.StyledProperty<Avalonia.Controls.MarkdownImageLoader> ImageLoaderProperty

ImageSourceProperty Field

Defines the Avalonia.Controls.Documents.MarkdownImage.ImageSource property.

public Avalonia.StyledProperty<string> ImageSourceProperty

ImageTitleProperty Field

Defines the Avalonia.Controls.Documents.MarkdownImage.ImageTitle property.

public Avalonia.StyledProperty<string> ImageTitleProperty