From 13003bdbb6eca20e65383c8dc22c170fff6c5183 Mon Sep 17 00:00:00 2001 From: whistyun Date: Sun, 15 May 2022 00:39:07 +0900 Subject: [PATCH] Setting a value to MarkdownStyle has no effect with DataTemplate. ref #34 --- MdXaml/MarkdownScrollViewer.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/MdXaml/MarkdownScrollViewer.cs b/MdXaml/MarkdownScrollViewer.cs index 389997b..f19ae77 100644 --- a/MdXaml/MarkdownScrollViewer.cs +++ b/MdXaml/MarkdownScrollViewer.cs @@ -47,14 +47,14 @@ public class MarkdownScrollViewer : FlowDocumentScrollViewer, IUriContext nameof(MarkdownStyle), typeof(Style), typeof(MarkdownScrollViewer), - new PropertyMetadata(null, UpdateStyle)); + new PropertyMetadata(MdStyle.Standard, UpdateStyle)); public static readonly DependencyProperty MarkdownStyleNameProperty = DependencyProperty.Register( nameof(MarkdownStyleName), typeof(string), typeof(MarkdownScrollViewer), - new PropertyMetadata(null, UpdateStyleName)); + new PropertyMetadata(nameof(MdStyle.Standard), UpdateStyleName)); public static readonly DependencyProperty AssetPathRootProperty = DependencyProperty.Register( @@ -253,7 +253,6 @@ public ClickAction ClickAction public MarkdownScrollViewer() { Engine = new Markdown(); - SetCurrentValue(MarkdownStyleNameProperty, nameof(MdStyle.Standard)); } private void UpdateClickAction()