You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MAUI/MarkdownViewer/Appearance.md
+10-11Lines changed: 10 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ documentation: ug
9
9
10
10
# Customize Appearance in .NET MAUI SfMarkdownViewer
11
11
12
-
The [SfMarkdownViewer]() control in .NET MAUI provides a powerful styling system through the `MarkdownStyleSettings` class. This allows developers to customize the visual presentation of Markdown content with precision and flexibility.
12
+
The [SfMarkdownViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.SfMarkdownViewer.html) control in .NET MAUI provides a powerful styling system through the [MarkdownStyleSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.MarkdownStyleSettings.html) class. This allows developers to customize the visual presentation of Markdown content with precision and flexibility.
13
13
14
14
## Key Features
15
15
@@ -29,15 +29,14 @@ The [SfMarkdownViewer]() control in .NET MAUI provides a powerful styling system
29
29
30
30
The appearance of headings and body content in SfMarkdownViewer can be customized using the MarkdownStyleSettings class.
31
31
32
-
-[H1FontSize](), [H2FontSize](), [H3FontSize]() – Gets or sets the font size for H1, H2, and H3 heading elements respectively.
33
-
-[H1Color](), [H2Color](), [H3Color]() – Gets or sets the text color for H1, H2, and H3 heading elements respectively.
34
-
-[BodyFontSize]() – Gets or sets the font size for regular paragraph text.
35
-
36
-
-[BodyTextColor]() – Gets or sets the text color for body content.
37
-
-[TableHeaderFontSize](), [TableDataFontSize]() – Gets or sets the font size for table headers and table content respectively.
38
-
-[TableHeaderTextColor](), [TableDataTextColor]() – Gets or sets the text color for table headers and table content respectively.
39
-
-[TableBackground]() – Gets or sets the background color for the entire table area.
40
-
-[CssStyleRules]() – Gets or sets raw CSS styles to override or extend default Markdown rendering behavior.
32
+
-[H1FontSize](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.MarkdownStyleSettings.html#Syncfusion_Maui_MarkdownViewer_MarkdownStyleSettings_H1FontSize), [H2FontSize](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.MarkdownStyleSettings.html#Syncfusion_Maui_MarkdownViewer_MarkdownStyleSettings_H2FontSize), [H3FontSize](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.MarkdownStyleSettings.html#Syncfusion_Maui_MarkdownViewer_MarkdownStyleSettings_H3FontSize) – Gets or sets the font size for H1, H2, and H3 heading elements respectively.
33
+
-[H1Color](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.MarkdownStyleSettings.html#Syncfusion_Maui_MarkdownViewer_MarkdownStyleSettings_H1Color), [H2Color](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.MarkdownStyleSettings.html#Syncfusion_Maui_MarkdownViewer_MarkdownStyleSettings_H2Color), [H3Color](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.MarkdownStyleSettings.html#Syncfusion_Maui_MarkdownViewer_MarkdownStyleSettings_H3Color) – Gets or sets the text color for H1, H2, and H3 heading elements respectively.
34
+
-[BodyFontSize](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.MarkdownStyleSettings.html#Syncfusion_Maui_MarkdownViewer_MarkdownStyleSettings_BodyFontSize) – Gets or sets the font size for regular paragraph text.
35
+
-[BodyTextColor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.MarkdownStyleSettings.html#Syncfusion_Maui_MarkdownViewer_MarkdownStyleSettings_BodyTextColor) – Gets or sets the text color for body content.
36
+
-[TableHeaderFontSize](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.MarkdownStyleSettings.html#Syncfusion_Maui_MarkdownViewer_MarkdownStyleSettings_TableHeaderFontSize), [TableDataFontSize](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.MarkdownStyleSettings.html#Syncfusion_Maui_MarkdownViewer_MarkdownStyleSettings_TableDataFontSize) – Gets or sets the font size for table headers and table content respectively.
37
+
-[TableHeaderTextColor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.MarkdownStyleSettings.html#Syncfusion_Maui_MarkdownViewer_MarkdownStyleSettings_TableHeaderTextColor), [TableDataTextColor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.MarkdownStyleSettings.html#Syncfusion_Maui_MarkdownViewer_MarkdownStyleSettings_TableDataTextColor) – Gets or sets the text color for table headers and table content respectively.
38
+
-[TableBackground](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.MarkdownStyleSettings.html#Syncfusion_Maui_MarkdownViewer_MarkdownStyleSettings_TableBackground) – Gets or sets the background color for the entire table area.
39
+
-[CssStyleRules](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.MarkdownStyleSettings.html#Syncfusion_Maui_MarkdownViewer_MarkdownStyleSettings_CssStyleRules) – Gets or sets raw CSS styles to override or extend default Markdown rendering behavior.
41
40
42
41
{% tabs %}
43
42
{% highlight xaml %}
@@ -97,4 +96,4 @@ The following output shows how these style settings enhance the appearance of re
With [MarkdownStyleSettings](), you gain full control over how Markdown content looks in your .NET MAUI app, whether you're building a documentation viewer, a note-taking app, or a styled content portal.
99
+
With [MarkdownStyleSettings](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.MarkdownStyleSettings.html), you gain full control over how Markdown content looks in your .NET MAUI app, whether you're building a documentation viewer, a note-taking app, or a styled content portal.
Copy file name to clipboardExpand all lines: MAUI/MarkdownViewer/ContentRetrieval.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,11 +9,11 @@ documentation: ug
9
9
10
10
# Retrieve Content Programmatically in .NET MAUI SfMarkdownViewer
11
11
12
-
The [SfMarkdownViewer]() control provides built-in methods to retrieve and transform Markdown content programmatically. These methods allow developers to access the raw Markdown, convert it to HTML, or extract plain text without formatting.
12
+
The [SfMarkdownViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.SfMarkdownViewer.html) control provides built-in methods to retrieve and transform Markdown content programmatically. These methods allow developers to access the raw Markdown, convert it to HTML, or extract plain text without formatting.
13
13
14
-
## GetMarkdownText()
14
+
## GetMarkdownText
15
15
16
-
Retrieves the raw Markdown content currently assigned to the `Source` property of the [SfMarkdownViewer]() control.
16
+
Retrieves the raw Markdown content currently assigned to the [Source](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.SfMarkdownViewer.html#Syncfusion_Maui_MarkdownViewer_SfMarkdownViewer_Source) property of the [SfMarkdownViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.SfMarkdownViewer.html) control.
17
17
18
18
{% tabs %}
19
19
{% highlight C# hl_lines="12" %}
@@ -29,13 +29,13 @@ Retrieves the raw Markdown content currently assigned to the `Source` property o
Converts the Markdown content of the SfMarkdownViewer control into HTML format and provides the result as a string.
41
41
@@ -53,15 +53,15 @@ Converts the Markdown content of the SfMarkdownViewer control into HTML format a
53
53
}
54
54
. . .
55
55
56
-
string html = MarkdownViewer.GetHtml();
56
+
string html = markdownViewer.GetHtmlText();
57
57
}
58
58
59
59
{% endhighlight %}
60
60
{% endtabs %}
61
61
62
-
## GetText()
62
+
## GetText
63
63
64
-
Extracts the plain text content from the Markdown assigned to the `SfMarkdownViewer` control, removing all Markdown formatting such as headings, emphasis, links, and code blocks.
64
+
Extracts the plain text content from the Markdown assigned to the [SfMarkdownViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.SfMarkdownViewer.html) control, removing all Markdown formatting such as headings, emphasis, links, and code blocks.
Copy file name to clipboardExpand all lines: MAUI/MarkdownViewer/DataBinding.md
+12-31Lines changed: 12 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,11 +9,11 @@ documentation: ug
9
9
10
10
# Loading Markdown Content in .NET MAUI MarkdownViewer
11
11
12
-
The [SfMarkdownViewer]() control supports flexible input sources, allowing developers to load Markdown content from strings, local files, embedded resources, and external URLs.
12
+
The [SfMarkdownViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.SfMarkdownViewer.html) control supports flexible input sources, allowing developers to load Markdown content from strings, local files, embedded resources, and external URLs.
13
13
14
14
## From String
15
15
16
-
Assign a Markdown-formatted string to the `Source` property of the SfMarkdownViewer control to render markdown content directly within your application.
16
+
Assign a Markdown-formatted string to the [Source](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.SfMarkdownViewer.html#Syncfusion_Maui_MarkdownViewer_SfMarkdownViewer_Source) property of the [SfMarkdownViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.SfMarkdownViewer.html) control to render markdown content directly within your application.
To load Markdown content from a local `.md` file, you can directly specify the file path and read its contents using standard file I/O and assign its content to the `Source` property of the `SfMarkdownViewer`.
To load Markdown content from a local `.md` file, you can directly specify the file path and read its contents using standard file I/O and assign its content to the [Source](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.SfMarkdownViewer.html#Syncfusion_Maui_MarkdownViewer_SfMarkdownViewer_Source) property of the [SfMarkdownViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.SfMarkdownViewer.html).
87
75
88
76
Use the following code-behind to read the file and assign its content to the Markdown Viewer:
89
77
@@ -96,10 +84,11 @@ public partial class MainPage : ContentPage
96
84
public MainPage()
97
85
{
98
86
InitializeComponent();
99
-
87
+
SfMarkdownViewer markdownViewer = new SfMarkdownViewer();
2. Use asynchronous file access to read and assign the content to the [Source](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.SfMarkdownViewer.html#Syncfusion_Maui_MarkdownViewer_SfMarkdownViewer_Source) property of the [SfMarkdownViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.MarkdownViewer.SfMarkdownViewer.html) control.
124
101
125
102
Refer to the following code-behind to read the embedded resource and assign its content to the Markdown Viewer:
126
103
@@ -130,18 +107,22 @@ Refer to the following code-behind to read the embedded resource and assign its
130
107
131
108
public partial class MainPage : ContentPage
132
109
{
110
+
SfMarkdownViewer markdownViewer;
111
+
133
112
public MainPage()
134
113
{
135
114
InitializeComponent();
115
+
markdownViewer = new SfMarkdownViewer();
136
116
_ = LoadMarkdownAsync();
117
+
Content = markdownViewer;
137
118
}
138
119
139
120
private async Task LoadMarkdownAsync()
140
121
{
141
122
using Stream stream = await FileSystem.OpenAppPackageFileAsync("MarkdownContent.md");
142
123
using StreamReader reader = new StreamReader(stream, Encoding.UTF8);
0 commit comments