Skip to content
bares43 edited this page May 23, 2021 · 6 revisions

Basic usage

  • You can customize the rendered markdown using Theme. Check documenation to see what you can do.

Using XAML

ViewModel

public string Content { get; set; }
public MarkdownTheme MarkdownTheme { get; set; }

XAML

  • Don't forget to add md namespace.
<ContentView xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:md="clr-namespace:Xam.Forms.Markdown;assembly=Xam.Forms.Markdown">
    <md:MarkdownView Markdown="{Binding Content}" Theme="{Binding MarkdownTheme}" />
</ContentView>

Using C#

var view = new MarkdownView();
view.Markdown = "# Hello world\n\nThis is my first native markdown rendering";
view.Theme = new DarkMarkdownTheme(); // Default is white, you also modify various values
this.Content = view;

How this plugin works

  • Markdown is parsed using Markdig.
  • This parsed elements are then rendered to native XF elements (StackLayout, Label etc.).
Clone this wiki locally