Skip to content

Commit f797d8a

Browse files
committed
fix: document not appears when loaded
1 parent f347b65 commit f797d8a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Markdown.Avalonia.Tight/MarkdownScrollViewer.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
using System.Linq;
2222
using System.Net.Http;
2323
using System.Text.RegularExpressions;
24+
using Avalonia.LogicalTree;
2425
using MdStyle = Markdown.Avalonia.MarkdownStyle;
2526

2627
namespace Markdown.Avalonia
@@ -148,6 +149,13 @@ public MarkdownScrollViewer()
148149
_viewer.Content = _wrapper;
149150
}
150151

152+
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
153+
{
154+
base.OnAttachedToVisualTree(e);
155+
156+
UpdateMarkdown();
157+
}
158+
151159
#region text selection
152160

153161
private bool _isLeftButtonPressed;

0 commit comments

Comments
 (0)