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
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.
100
+
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.
SfMarkdownViewer markdownViewer = new SfMarkdownViewer();
204
-
Content = markdownViewer;
205
-
}
206
-
}
207
-
}
201
+
InitializeComponent();
202
+
SfMarkdownViewer markdownViewer = new SfMarkdownViewer();
203
+
Content = markdownViewer;
204
+
}
205
+
}
206
+
}
208
207
209
208
{% endhighlight %}
210
209
{% endtabs %}
211
210
211
+
{% endtabcontent %}
212
+
{% endtabcontents %}
213
+
212
214
## Step 5: Add Source to the SfMarkdownViewer
213
215
214
216
To display Markdown content, assign a string to the `Source` property of the SfMarkdownViewer control. This string can contain standard Markdown syntax such as headings, bold text, lists, and images.
215
217
216
218
{% tabs %}
217
219
{% highlight xaml %}
218
220
219
-
<markdown:SfMarkdownViewer>
220
-
<markdown:SfMarkdownViewer.Source>
221
-
<x:String>
222
-
<![CDATA[
223
-
# What is Markdown Viewer?
224
-
Markdown View is a UI control in .NET MAUI that allows developers to render Markdown content with full formatting support. It is designed to work efficiently across both mobile and desktop platforms. The viewer supports headings, bold and italic text, lists, tables, images, code blocks, etc.
225
-
226
-
# Header 1
227
-
Used for the main title or top-level heading in a Markdown document.
228
-
229
-
## Header 2
230
-
Used to define major sections within your Markdown content.
231
-
232
-
## Table
233
-
234
-
| | Column 1 | Column 2 | Column 3 |
235
-
|--------------|----------|----------|----------|
236
-
| Row 1 | Content | Content | Content |
237
-
| Row 2 | Content | Content | Content |
238
-
| Row 3 | Content | Content | Content |
239
-
]]>
240
-
</x:String>
241
-
</markdown:SfMarkdownViewer.Source>
242
-
</markdown:SfMarkdownViewer>
243
-
{% endhighlight %}
244
-
245
-
{% highlight C# %}
246
-
247
-
public partial class MainPage : ContentPage
248
-
{
249
-
private const string markdownContent = @"# What is Markdown Viewer?
250
-
Markdown View is a UI control in .NET MAUI that allows developers to render Markdown content with full formatting support. It is designed to work efficiently across both mobile and desktop platforms. The viewer supports headings, bold and italic text, lists, tables, images, code blocks, etc.
221
+
<markdown:SfMarkdownViewer>
222
+
<markdown:SfMarkdownViewer.Source>
223
+
<x:String>
224
+
<![CDATA[
225
+
# What is the Markdown Viewer?
226
+
The Markdown Viewer is a UI control in .NET MAUI that allows developers to render Markdown content with full formatting support. It was designed to work efficiently on both mobile and desktop platforms. The viewer supports headings, bold and italic text, lists, tables, images, code blocks and more.
251
227
252
228
# Header 1
253
229
Used for the main title or top-level heading in a Markdown document.
254
230
255
231
## Header 2
256
232
Used to define major sections within your Markdown content.
257
233
258
-
## Table
234
+
### Table
259
235
260
236
| | Column 1 | Column 2 | Column 3 |
261
237
|--------------|----------|----------|----------|
262
238
| Row 1 | Content | Content | Content |
263
239
| Row 2 | Content | Content | Content |
264
-
| Row 3 | Content | Content | Content |";
240
+
| Row 3 | Content | Content | Content |
241
+
]]>
242
+
</x:String>
243
+
</markdown:SfMarkdownViewer.Source>
244
+
</markdown:SfMarkdownViewer>
265
245
266
-
public MainPage()
267
-
{
268
-
InitializeComponent();
269
-
SfMarkdownViewer markdownViewer = new SfMarkdownViewer();
270
-
markdownViewer.Source = markdownContent;
271
-
Content = markdownViewer;
272
-
}
273
-
}
246
+
{% endhighlight %}
247
+
248
+
{% highlight C# %}
249
+
250
+
public partial class MainPage : ContentPage
251
+
{
252
+
private const string markdownContent = @"# What is the Markdown Viewer?
253
+
The Markdown Viewer is a UI control in .NET MAUI that allows developers to render Markdown content with full formatting support. It was designed to work efficiently on both mobile and desktop platforms. The viewer supports headings, bold and italic text, lists, tables, images, code blocks and more.
254
+
255
+
# Header 1
256
+
Used for the main title or top-level heading in a Markdown document.
257
+
258
+
## Header 2
259
+
Used to define major sections within your Markdown content.
260
+
261
+
### Table
262
+
263
+
| | Column 1 | Column 2 | Column 3 |
264
+
|--------------|----------|----------|----------|
265
+
| Row 1 | Content | Content | Content |
266
+
| Row 2 | Content | Content | Content |
267
+
| Row 3 | Content | Content | Content |";
268
+
269
+
public MainPage()
270
+
{
271
+
InitializeComponent();
272
+
SfMarkdownViewer markdownViewer = new SfMarkdownViewer();
273
+
markdownViewer.Source = markdownContent;
274
+
Content = markdownViewer;
275
+
}
276
+
}
274
277
275
278
{% endhighlight %}
276
279
{% endtabs %}
277
280
278
281
N> For more details about binding Markdown content from various sources, refer to [MarkdownSources](/MarkdownSources.md).
279
282
280
-
{% endtabcontent %}
281
-
{% endtabcontents %}
282
-
283
283

284
284
285
-
You can access a complete getting started sample from this [link.]()
285
+
You can access a complete getting started sample [here]().
0 commit comments