|
2 | 2 | // The .NET Foundation licenses this file to you under the MIT license.
|
3 | 3 | // See the LICENSE file in the project root for more information.
|
4 | 4 |
|
| 5 | +using Markdig.Syntax; |
| 6 | + |
5 | 7 | namespace CommunityToolkit.Labs.WinUI.MarkdownTextBlock;
|
6 | 8 |
|
7 | 9 | public partial class MarkdownTextBlock
|
@@ -79,6 +81,15 @@ public partial class MarkdownTextBlock
|
79 | 81 | typeof(MarkdownTextBlock),
|
80 | 82 | new PropertyMetadata(false));
|
81 | 83 |
|
| 84 | + /// <summary> |
| 85 | + /// Identifies the <see cref="MarkdownDocument"/> dependency property. |
| 86 | + /// </summary> |
| 87 | + private static readonly DependencyProperty MarkdownDocumentProperty = DependencyProperty.Register( |
| 88 | + nameof(MarkdownDocument), |
| 89 | + typeof(MarkdownDocument), |
| 90 | + typeof(MarkdownTextBlock), |
| 91 | + new PropertyMetadata(null)); |
| 92 | + |
82 | 93 | public MarkdownConfig Config
|
83 | 94 | {
|
84 | 95 | get => (MarkdownConfig)GetValue(ConfigProperty);
|
@@ -147,4 +158,13 @@ public bool UseSoftlineBreakAsHardlineBreak
|
147 | 158 | get => (bool)GetValue(UseSoftlineBreakAsHardlineBreakProperty);
|
148 | 159 | set => SetValue(UseSoftlineBreakAsHardlineBreakProperty, value);
|
149 | 160 | }
|
| 161 | + |
| 162 | + /// <summary> |
| 163 | + /// Gets the parsed markdown document. May be null if the document has not been parsed yet. |
| 164 | + /// </summary> |
| 165 | + public MarkdownDocument? MarkdownDocument |
| 166 | + { |
| 167 | + get => (MarkdownDocument)GetValue(MarkdownDocumentProperty); |
| 168 | + private set => SetValue(MarkdownDocumentProperty, value); |
| 169 | + } |
150 | 170 | }
|
0 commit comments