forked from dotnet-ad/MarkdownView
-
-
Notifications
You must be signed in to change notification settings - Fork 6
Home
bares43 edited this page May 23, 2021
·
6 revisions
- You can customize the rendered markdown using Theme. Check documenation to see what you can do.
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>
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;
- Markdown is parsed using Markdig.
- This parsed elements are then rendered to native XF elements (
StackLayout
,Label
etc.).