diff --git a/components/MarkdownTextBlock/samples/MarkdownTextBlockCustomThemeSample.xaml b/components/MarkdownTextBlock/samples/MarkdownTextBlockCustomThemeSample.xaml
index 326987686..5da90bafc 100644
--- a/components/MarkdownTextBlock/samples/MarkdownTextBlockCustomThemeSample.xaml
+++ b/components/MarkdownTextBlock/samples/MarkdownTextBlockCustomThemeSample.xaml
@@ -1,4 +1,4 @@
-
+
diff --git a/components/MarkdownTextBlock/samples/MarkdownTextBlockCustomThemeSample.xaml.cs b/components/MarkdownTextBlock/samples/MarkdownTextBlockCustomThemeSample.xaml.cs
index 127efbee0..eb83d7024 100644
--- a/components/MarkdownTextBlock/samples/MarkdownTextBlockCustomThemeSample.xaml.cs
+++ b/components/MarkdownTextBlock/samples/MarkdownTextBlockCustomThemeSample.xaml.cs
@@ -2,8 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-using CommunityToolkit.WinUI.Controls;
-
namespace MarkdownTextBlockExperiment.Samples;
///
@@ -12,8 +10,6 @@ namespace MarkdownTextBlockExperiment.Samples;
[ToolkitSample(id: nameof(MarkdownTextBlockCustomThemeSample), "Custom Theme", description: "A sample showcasing custom theming options with live editing for headings, code blocks, quotes, tables, and more.")]
public sealed partial class MarkdownTextBlockCustomThemeSample : MarkdownTextBlockCustomThemeSampleBase
{
- public MarkdownConfig MarkdownConfig { get; private set; }
-
public string MarkdownText { get; } = @"
# Custom Theme Demo
@@ -96,7 +92,7 @@ Try adjusting the **Bullet Spacing** and **Gutter Width** settings to see how li
- Adjust the theme settings in the options panel
- The gutter width controls how much each level is indented
- The bullet spacing controls space after the bullet character
-- Click **Apply Changes** to see updates
+- Changes apply live via bindings
- Use **Reset to Defaults** to start over
Numbered lists work too:
@@ -109,20 +105,24 @@ 1. Deep nesting works
3. Third item
";
+ // Converter methods for x:Bind function bindings (must be on the x:Class type, not the base)
+ public Brush GetHeadingBrush(int index) => HeadingColors[Math.Clamp(index, 0, HeadingColors.Length - 1)];
+ public Brush GetInlineCodeBrush(int index) => InlineCodeColors[Math.Clamp(index, 0, InlineCodeColors.Length - 1)];
+ public Brush GetCodeBackgroundBrush(int index) => CodeBackgroundColors[Math.Clamp(index, 0, CodeBackgroundColors.Length - 1)];
+ public Brush GetCodeBorderBrush(int index) => CodeBorderColors[Math.Clamp(index, 0, CodeBorderColors.Length - 1)];
+ public Brush GetQuoteBrush(int index) => QuoteColors[Math.Clamp(index, 0, QuoteColors.Length - 1)];
+ public FontFamily GetCodeFont(int index) => CodeFonts[Math.Clamp(index, 0, CodeFonts.Length - 1)];
+ public Stretch GetImageStretch(int index) => ImageStretchOptions[Math.Clamp(index, 0, ImageStretchOptions.Length - 1)];
+ public Windows.UI.Text.FontWeight GetBoldFontWeight(int index) => BoldFontWeights[Math.Clamp(index, 0, BoldFontWeights.Length - 1)];
+ public Thickness GetUniformThickness(double value) => new Thickness(value);
+ public CornerRadius GetUniformCornerRadius(double value) => new CornerRadius(value);
+ public Thickness GetHorizontalPadding(double value) => new Thickness(value, value / 2, value, value / 2);
+ public Thickness GetLeftBorderThickness(double value) => new Thickness(value, 0, 0, 0);
+ public CornerRadius GetRightCornerRadius(double value) => new CornerRadius(0, value, value, 0);
+ public Thickness GetVerticalMargin(double value) => new Thickness(0, value, 0, value);
+
public MarkdownTextBlockCustomThemeSample()
{
- MarkdownConfig = new MarkdownConfig { Themes = CreateThemes() };
this.InitializeComponent();
}
-
- public override void ApplyTheme()
- {
- MarkdownConfig = new MarkdownConfig { Themes = CreateThemes() };
-
- // Force re-render by toggling text
- MarkdownTextBlock.Config = MarkdownConfig;
- var text = MarkdownTextBlock.Text;
- MarkdownTextBlock.Text = "";
- MarkdownTextBlock.Text = text;
- }
}
diff --git a/components/MarkdownTextBlock/samples/MarkdownTextBlockCustomThemeSampleBase.cs b/components/MarkdownTextBlock/samples/MarkdownTextBlockCustomThemeSampleBase.cs
index c1c49e5d2..4768e7a90 100644
--- a/components/MarkdownTextBlock/samples/MarkdownTextBlockCustomThemeSampleBase.cs
+++ b/components/MarkdownTextBlock/samples/MarkdownTextBlockCustomThemeSampleBase.cs
@@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-using CommunityToolkit.WinUI.Controls;
using Microsoft.UI;
using Windows.UI;
@@ -14,7 +13,7 @@
namespace MarkdownTextBlockExperiment.Samples;
-public abstract partial class MarkdownTextBlockCustomThemeSampleBase : Page
+public partial class MarkdownTextBlockCustomThemeSampleBase : Page
{
// Dependency properties for theme customization
public static readonly DependencyProperty H1FontSizeProperty =
@@ -372,67 +371,7 @@ public double ListGutterWidth
FontWeights.ExtraBold
};
- public MarkdownThemes CreateThemes()
- {
- return new MarkdownThemes
- {
- H1FontSize = H1FontSize,
- H1FontWeight = FontWeights.Bold,
- H1Foreground = HeadingColors[H1ColorIndex],
- H1Margin = new Thickness(0, 20, 0, 10),
-
- H2FontSize = H2FontSize,
- H2FontWeight = FontWeights.SemiBold,
- H2Foreground = new SolidColorBrush(Colors.MediumSlateBlue),
-
- H3FontSize = H3FontSize,
- H3FontWeight = FontWeights.SemiBold,
- H3Foreground = new SolidColorBrush(Colors.MediumPurple),
-
- InlineCodeFontSize = InlineCodeFontSize,
- InlineCodePadding = new Thickness(InlineCodePadding, InlineCodePadding / 2, InlineCodePadding, InlineCodePadding / 2),
- InlineCodeCornerRadius = new CornerRadius(InlineCodeCornerRadius),
- InlineCodeBorderThickness = new Thickness(InlineCodeBorderThickness),
- InlineCodeForeground = InlineCodeColors[InlineCodeColorIndex],
- InlineCodeBackground = CodeBackgroundColors[InlineCodeBackgroundColorIndex],
- InlineCodeBorderBrush = CodeBorderColors[InlineCodeBorderColorIndex],
-
- CodeBlockPadding = new Thickness(CodeBlockPadding),
- CodeBlockCornerRadius = new CornerRadius(CodeBlockCornerRadius),
- CodeBlockBorderThickness = new Thickness(CodeBlockBorderThickness),
- CodeBlockFontFamily = CodeFonts[CodeBlockFontIndex],
- CodeBlockBackground = CodeBackgroundColors[CodeBlockBackgroundColorIndex],
- CodeBlockForeground = new SolidColorBrush(Colors.LightGreen),
- CodeBlockBorderBrush = CodeBorderColors[CodeBlockBorderColorIndex],
-
- QuoteBorderThickness = new Thickness(QuoteBorderWidth, 0, 0, 0),
- QuotePadding = new Thickness(QuotePadding, QuotePadding / 2, QuotePadding, QuotePadding / 2),
- QuoteCornerRadius = new CornerRadius(0, QuoteCornerRadius, QuoteCornerRadius, 0),
- QuoteBorderBrush = QuoteColors[QuoteColorIndex],
- QuoteBackground = new SolidColorBrush(Color.FromArgb(20, 100, 149, 237)),
- QuoteForeground = new SolidColorBrush(Colors.CornflowerBlue),
-
- TableCellPadding = new Thickness(TableCellPadding, TableCellPadding / 2, TableCellPadding, TableCellPadding / 2),
- TableBorderThickness = TableBorderThickness,
- TableBorderBrush = new SolidColorBrush(Colors.SlateGray),
- TableHeadingBackground = new SolidColorBrush(Color.FromArgb(40, 100, 149, 237)),
- HorizontalRuleThickness = HorizontalRuleThickness,
- HorizontalRuleMargin = new Thickness(0, HorizontalRuleMargin, 0, HorizontalRuleMargin),
- HorizontalRuleBrush = new SolidColorBrush(Colors.MediumSlateBlue),
-
- LinkForeground = new SolidColorBrush(Colors.DeepSkyBlue),
-
- ImageMaxWidth = ImageMaxWidth,
- ImageMaxHeight = ImageMaxHeight,
- ImageStretch = ImageStretchOptions[ImageStretchIndex],
-
- BoldFontWeight = BoldFontWeights[BoldFontWeightIndex],
-
- ListBulletSpacing = ListBulletSpacing,
- ListGutterWidth = ListGutterWidth,
- };
- }
public void ResetToDefaults()
{
@@ -476,6 +415,4 @@ public void ResetToDefaults()
ListBulletSpacing = 4;
ListGutterWidth = 30;
}
-
- public abstract void ApplyTheme();
}
diff --git a/components/MarkdownTextBlock/samples/MarkdownTextBlockExampleSample.xaml b/components/MarkdownTextBlock/samples/MarkdownTextBlockExampleSample.xaml
index 043e52c46..ad89fdf6f 100644
--- a/components/MarkdownTextBlock/samples/MarkdownTextBlockExampleSample.xaml
+++ b/components/MarkdownTextBlock/samples/MarkdownTextBlockExampleSample.xaml
@@ -11,7 +11,6 @@
_config;
- set => _config = value;
- }
-
public string Text
{
get => _text;
@@ -600,7 +593,6 @@ public string Text
public MarkdownTextBlockExampleSample()
{
this.InitializeComponent();
- _config = new MarkdownConfig();
_text = _markdown;
MarkdownTextBlock.OnLinkClicked += MarkdownTextBlock_OnLinkClicked;
}
diff --git a/components/MarkdownTextBlock/samples/ThemeOptionsPane.xaml b/components/MarkdownTextBlock/samples/ThemeOptionsPane.xaml
index 4946ef686..99f2f1c44 100644
--- a/components/MarkdownTextBlock/samples/ThemeOptionsPane.xaml
+++ b/components/MarkdownTextBlock/samples/ThemeOptionsPane.xaml
@@ -15,9 +15,6 @@
Spacing="8">
-
diff --git a/components/MarkdownTextBlock/samples/ThemeOptionsPane.xaml.cs b/components/MarkdownTextBlock/samples/ThemeOptionsPane.xaml.cs
index ab3c798dc..57fd101e8 100644
--- a/components/MarkdownTextBlock/samples/ThemeOptionsPane.xaml.cs
+++ b/components/MarkdownTextBlock/samples/ThemeOptionsPane.xaml.cs
@@ -140,12 +140,6 @@ private void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
SyncValuesToSample();
}
- private void ApplyTheme_Click(object sender, RoutedEventArgs e)
- {
- SyncValuesToSample();
- _sample.ApplyTheme();
- }
-
private void ResetTheme_Click(object sender, RoutedEventArgs e)
{
_sample.ResetToDefaults();
@@ -153,7 +147,5 @@ private void ResetTheme_Click(object sender, RoutedEventArgs e)
_isInitializing = true;
LoadValuesFromSample();
_isInitializing = false;
-
- _sample.ApplyTheme();
}
}
diff --git a/components/MarkdownTextBlock/src/HtmlWriter.cs b/components/MarkdownTextBlock/src/HtmlWriter.cs
index a094b506c..00381418d 100644
--- a/components/MarkdownTextBlock/src/HtmlWriter.cs
+++ b/components/MarkdownTextBlock/src/HtmlWriter.cs
@@ -33,7 +33,7 @@ public static void WriteHtml(WinUIRenderer renderer, HtmlNodeCollection nodes)
IAddChild hyperLink;
if (node.ChildNodes.Any(n => n.Name != "#text"))
{
- var myHyperlinkButton = new MyHyperlinkButton(node, renderer.Config.BaseUrl, renderer.Config.Themes);
+ var myHyperlinkButton = new MyHyperlinkButton(node, renderer.MarkdownTextBlock);
myHyperlinkButton.ClickEvent += (sender, e) =>
{
var button = (HyperlinkButton)sender;
@@ -48,7 +48,7 @@ public static void WriteHtml(WinUIRenderer renderer, HtmlNodeCollection nodes)
}
else
{
- var myHyperlink = new MyHyperlink(node, renderer.Config.BaseUrl, renderer.Config.Themes);
+ var myHyperlink = new MyHyperlink(node, renderer.MarkdownTextBlock);
myHyperlink.ClickEvent += (sender, e) =>
{
var uri = sender.NavigateUri;
@@ -66,7 +66,7 @@ public static void WriteHtml(WinUIRenderer renderer, HtmlNodeCollection nodes)
}
else if (inlineTagName == "img")
{
- var image = new MyImage(node, renderer.Config);
+ var image = new MyImage(node, renderer.MarkdownTextBlock);
renderer.WriteInline(image);
}
else
@@ -84,13 +84,17 @@ public static void WriteHtml(WinUIRenderer renderer, HtmlNodeCollection nodes)
if (tag == "details")
{
block = new MyDetails(node);
- node.ChildNodes.Remove(node.ChildNodes.FirstOrDefault(x => x.Name == "summary" || x.Name == "header"));
+ var summaryNode = node.ChildNodes.FirstOrDefault(x => x.Name == "summary" || x.Name == "header");
+ if (summaryNode != null)
+ {
+ node.ChildNodes.Remove(summaryNode);
+ }
renderer.Push(block);
WriteHtml(renderer, node.ChildNodes);
}
else if (tag.IsHeading())
{
- var heading = new MyHeading(node, renderer.Config);
+ var heading = new MyHeading(node, renderer.MarkdownTextBlock);
renderer.Push(heading);
WriteHtml(renderer, node.ChildNodes);
}
diff --git a/components/MarkdownTextBlock/src/MarkdownConfig.cs b/components/MarkdownTextBlock/src/MarkdownConfig.cs
deleted file mode 100644
index d04187c2d..000000000
--- a/components/MarkdownTextBlock/src/MarkdownConfig.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-namespace CommunityToolkit.WinUI.Controls;
-
-public record MarkdownConfig
-{
- public string? BaseUrl { get; set; }
- public IImageProvider? ImageProvider { get; set; }
- public ISVGRenderer? SVGRenderer { get; set; }
- public MarkdownThemes Themes { get; set; } = MarkdownThemes.Default;
-
- public static MarkdownConfig Default = new();
-}
diff --git a/components/MarkdownTextBlock/src/MarkdownTextBlock.Properties.cs b/components/MarkdownTextBlock/src/MarkdownTextBlock.Properties.cs
index 06ad510cc..6c0aaf327 100644
--- a/components/MarkdownTextBlock/src/MarkdownTextBlock.Properties.cs
+++ b/components/MarkdownTextBlock/src/MarkdownTextBlock.Properties.cs
@@ -4,18 +4,48 @@
using Markdig.Syntax;
+#if !WINAPPSDK
+using FontWeight = Windows.UI.Text.FontWeight;
+using FontWeights = Windows.UI.Text.FontWeights;
+using DispatcherQueue = Windows.System.DispatcherQueue;
+#else
+using FontWeight = Windows.UI.Text.FontWeight;
+using FontWeights = Microsoft.UI.Text.FontWeights;
+using DispatcherQueue = Microsoft.UI.Dispatching.DispatcherQueue;
+#endif
+
namespace CommunityToolkit.WinUI.Controls;
public partial class MarkdownTextBlock
{
///
- /// Identifies the dependency property.
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty BaseUrlProperty = DependencyProperty.Register(
+ nameof(BaseUrl),
+ typeof(string),
+ typeof(MarkdownTextBlock),
+ new PropertyMetadata(null)
+ );
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty ImageProviderProperty = DependencyProperty.Register(
+ nameof(ImageProvider),
+ typeof(IImageProvider),
+ typeof(MarkdownTextBlock),
+ new PropertyMetadata(null)
+ );
+
+ ///
+ /// Identifies the dependency property.
///
- private static readonly DependencyProperty ConfigProperty = DependencyProperty.Register(
- nameof(Config),
- typeof(MarkdownConfig),
+ public static readonly DependencyProperty SVGRendererProperty = DependencyProperty.Register(
+ nameof(SVGRenderer),
+ typeof(ISVGRenderer),
typeof(MarkdownTextBlock),
- new PropertyMetadata(new MarkdownConfig(), OnConfigChanged)
+ new PropertyMetadata(null)
);
///
@@ -125,10 +155,467 @@ private static void OnIsTextSelectionEnabledChanged(DependencyObject d, Dependen
}
}
- public MarkdownConfig Config
+ // ── Theme DPs ───────────────────────────────────────────────────────
+ // Defaults come from the XAML style. C# defaults are type-appropriate
+ // fallbacks only. The shared property-changed callback batches multiple
+ // simultaneous DP updates (e.g. theme switch) into a single re-render.
+
+ private static void OnThemePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ if (d is MarkdownTextBlock self && !self._themePropertyChangeQueued)
+ {
+ self._themePropertyChangeQueued = true;
+ DispatcherQueue.GetForCurrentThread().TryEnqueue(() =>
+ {
+ self._themePropertyChangeQueued = false;
+ self.ApplyText(true);
+ });
+ }
+ }
+
+ // ── Heading font sizes ──────────────────────────────────────────────
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty H1FontSizeProperty =
+ DependencyProperty.Register(nameof(H1FontSize), typeof(double), typeof(MarkdownTextBlock), new PropertyMetadata(0d, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty H2FontSizeProperty =
+ DependencyProperty.Register(nameof(H2FontSize), typeof(double), typeof(MarkdownTextBlock), new PropertyMetadata(0d, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty H3FontSizeProperty =
+ DependencyProperty.Register(nameof(H3FontSize), typeof(double), typeof(MarkdownTextBlock), new PropertyMetadata(0d, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty H4FontSizeProperty =
+ DependencyProperty.Register(nameof(H4FontSize), typeof(double), typeof(MarkdownTextBlock), new PropertyMetadata(0d, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty H5FontSizeProperty =
+ DependencyProperty.Register(nameof(H5FontSize), typeof(double), typeof(MarkdownTextBlock), new PropertyMetadata(0d, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty H6FontSizeProperty =
+ DependencyProperty.Register(nameof(H6FontSize), typeof(double), typeof(MarkdownTextBlock), new PropertyMetadata(0d, OnThemePropertyChanged));
+
+ // ── Heading foregrounds ─────────────────────────────────────────────
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty H1ForegroundProperty =
+ DependencyProperty.Register(nameof(H1Foreground), typeof(Brush), typeof(MarkdownTextBlock), new PropertyMetadata(null, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty H2ForegroundProperty =
+ DependencyProperty.Register(nameof(H2Foreground), typeof(Brush), typeof(MarkdownTextBlock), new PropertyMetadata(null, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty H3ForegroundProperty =
+ DependencyProperty.Register(nameof(H3Foreground), typeof(Brush), typeof(MarkdownTextBlock), new PropertyMetadata(null, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty H4ForegroundProperty =
+ DependencyProperty.Register(nameof(H4Foreground), typeof(Brush), typeof(MarkdownTextBlock), new PropertyMetadata(null, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty H5ForegroundProperty =
+ DependencyProperty.Register(nameof(H5Foreground), typeof(Brush), typeof(MarkdownTextBlock), new PropertyMetadata(null, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty H6ForegroundProperty =
+ DependencyProperty.Register(nameof(H6Foreground), typeof(Brush), typeof(MarkdownTextBlock), new PropertyMetadata(null, OnThemePropertyChanged));
+
+ // ── Heading font weights ────────────────────────────────────────────
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty H1FontWeightProperty =
+ DependencyProperty.Register(nameof(H1FontWeight), typeof(FontWeight), typeof(MarkdownTextBlock), new PropertyMetadata(default(FontWeight), OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty H2FontWeightProperty =
+ DependencyProperty.Register(nameof(H2FontWeight), typeof(FontWeight), typeof(MarkdownTextBlock), new PropertyMetadata(default(FontWeight), OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty H3FontWeightProperty =
+ DependencyProperty.Register(nameof(H3FontWeight), typeof(FontWeight), typeof(MarkdownTextBlock), new PropertyMetadata(default(FontWeight), OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty H4FontWeightProperty =
+ DependencyProperty.Register(nameof(H4FontWeight), typeof(FontWeight), typeof(MarkdownTextBlock), new PropertyMetadata(default(FontWeight), OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty H5FontWeightProperty =
+ DependencyProperty.Register(nameof(H5FontWeight), typeof(FontWeight), typeof(MarkdownTextBlock), new PropertyMetadata(default(FontWeight), OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty H6FontWeightProperty =
+ DependencyProperty.Register(nameof(H6FontWeight), typeof(FontWeight), typeof(MarkdownTextBlock), new PropertyMetadata(default(FontWeight), OnThemePropertyChanged));
+
+ // ── Heading margins ─────────────────────────────────────────────────
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty H1MarginProperty =
+ DependencyProperty.Register(nameof(H1Margin), typeof(Thickness), typeof(MarkdownTextBlock), new PropertyMetadata(default(Thickness), OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty H2MarginProperty =
+ DependencyProperty.Register(nameof(H2Margin), typeof(Thickness), typeof(MarkdownTextBlock), new PropertyMetadata(default(Thickness), OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty H3MarginProperty =
+ DependencyProperty.Register(nameof(H3Margin), typeof(Thickness), typeof(MarkdownTextBlock), new PropertyMetadata(default(Thickness), OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty H4MarginProperty =
+ DependencyProperty.Register(nameof(H4Margin), typeof(Thickness), typeof(MarkdownTextBlock), new PropertyMetadata(default(Thickness), OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty H5MarginProperty =
+ DependencyProperty.Register(nameof(H5Margin), typeof(Thickness), typeof(MarkdownTextBlock), new PropertyMetadata(default(Thickness), OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty H6MarginProperty =
+ DependencyProperty.Register(nameof(H6Margin), typeof(Thickness), typeof(MarkdownTextBlock), new PropertyMetadata(default(Thickness), OnThemePropertyChanged));
+
+ // ── Inline code ─────────────────────────────────────────────────────
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty InlineCodeBackgroundProperty =
+ DependencyProperty.Register(nameof(InlineCodeBackground), typeof(Brush), typeof(MarkdownTextBlock), new PropertyMetadata(null, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty InlineCodeForegroundProperty =
+ DependencyProperty.Register(nameof(InlineCodeForeground), typeof(Brush), typeof(MarkdownTextBlock), new PropertyMetadata(null, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty InlineCodeBorderBrushProperty =
+ DependencyProperty.Register(nameof(InlineCodeBorderBrush), typeof(Brush), typeof(MarkdownTextBlock), new PropertyMetadata(null, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty InlineCodeBorderThicknessProperty =
+ DependencyProperty.Register(nameof(InlineCodeBorderThickness), typeof(Thickness), typeof(MarkdownTextBlock), new PropertyMetadata(default(Thickness), OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty InlineCodeCornerRadiusProperty =
+ DependencyProperty.Register(nameof(InlineCodeCornerRadius), typeof(CornerRadius), typeof(MarkdownTextBlock), new PropertyMetadata(default(CornerRadius), OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty InlineCodePaddingProperty =
+ DependencyProperty.Register(nameof(InlineCodePadding), typeof(Thickness), typeof(MarkdownTextBlock), new PropertyMetadata(default(Thickness), OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty InlineCodeFontSizeProperty =
+ DependencyProperty.Register(nameof(InlineCodeFontSize), typeof(double), typeof(MarkdownTextBlock), new PropertyMetadata(0d, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty InlineCodeFontWeightProperty =
+ DependencyProperty.Register(nameof(InlineCodeFontWeight), typeof(FontWeight), typeof(MarkdownTextBlock), new PropertyMetadata(default(FontWeight), OnThemePropertyChanged));
+
+ // ── Bold ────────────────────────────────────────────────────────────
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty BoldFontWeightProperty =
+ DependencyProperty.Register(nameof(BoldFontWeight), typeof(FontWeight), typeof(MarkdownTextBlock), new PropertyMetadata(default(FontWeight), OnThemePropertyChanged));
+
+ // ── Code block ──────────────────────────────────────────────────────
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty CodeBlockBackgroundProperty =
+ DependencyProperty.Register(nameof(CodeBlockBackground), typeof(Brush), typeof(MarkdownTextBlock), new PropertyMetadata(null, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty CodeBlockBorderBrushProperty =
+ DependencyProperty.Register(nameof(CodeBlockBorderBrush), typeof(Brush), typeof(MarkdownTextBlock), new PropertyMetadata(null, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty CodeBlockForegroundProperty =
+ DependencyProperty.Register(nameof(CodeBlockForeground), typeof(Brush), typeof(MarkdownTextBlock), new PropertyMetadata(null, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty CodeBlockBorderThicknessProperty =
+ DependencyProperty.Register(nameof(CodeBlockBorderThickness), typeof(Thickness), typeof(MarkdownTextBlock), new PropertyMetadata(default(Thickness), OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty CodeBlockPaddingProperty =
+ DependencyProperty.Register(nameof(CodeBlockPadding), typeof(Thickness), typeof(MarkdownTextBlock), new PropertyMetadata(default(Thickness), OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty CodeBlockMarginProperty =
+ DependencyProperty.Register(nameof(CodeBlockMargin), typeof(Thickness), typeof(MarkdownTextBlock), new PropertyMetadata(default(Thickness), OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty CodeBlockFontFamilyProperty =
+ DependencyProperty.Register(nameof(CodeBlockFontFamily), typeof(FontFamily), typeof(MarkdownTextBlock), new PropertyMetadata(null, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty CodeBlockCornerRadiusProperty =
+ DependencyProperty.Register(nameof(CodeBlockCornerRadius), typeof(CornerRadius), typeof(MarkdownTextBlock), new PropertyMetadata(default(CornerRadius), OnThemePropertyChanged));
+
+ // ── Horizontal rule ─────────────────────────────────────────────────
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty HorizontalRuleBrushProperty =
+ DependencyProperty.Register(nameof(HorizontalRuleBrush), typeof(Brush), typeof(MarkdownTextBlock), new PropertyMetadata(null, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty HorizontalRuleThicknessProperty =
+ DependencyProperty.Register(nameof(HorizontalRuleThickness), typeof(double), typeof(MarkdownTextBlock), new PropertyMetadata(0d, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty HorizontalRuleMarginProperty =
+ DependencyProperty.Register(nameof(HorizontalRuleMargin), typeof(Thickness), typeof(MarkdownTextBlock), new PropertyMetadata(default(Thickness), OnThemePropertyChanged));
+
+ // ── Link ────────────────────────────────────────────────────────────
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty LinkForegroundProperty =
+ DependencyProperty.Register(nameof(LinkForeground), typeof(Brush), typeof(MarkdownTextBlock), new PropertyMetadata(null, OnThemePropertyChanged));
+
+ // ── Paragraph / list ────────────────────────────────────────────────
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty ParagraphMarginProperty =
+ DependencyProperty.Register(nameof(ParagraphMargin), typeof(Thickness), typeof(MarkdownTextBlock), new PropertyMetadata(default(Thickness), OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty ParagraphLineHeightProperty =
+ DependencyProperty.Register(nameof(ParagraphLineHeight), typeof(double), typeof(MarkdownTextBlock), new PropertyMetadata(0d, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty ListBulletSpacingProperty =
+ DependencyProperty.Register(nameof(ListBulletSpacing), typeof(double), typeof(MarkdownTextBlock), new PropertyMetadata(0d, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty ListGutterWidthProperty =
+ DependencyProperty.Register(nameof(ListGutterWidth), typeof(double), typeof(MarkdownTextBlock), new PropertyMetadata(0d, OnThemePropertyChanged));
+
+ // ── Quote ───────────────────────────────────────────────────────────
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty QuoteBackgroundProperty =
+ DependencyProperty.Register(nameof(QuoteBackground), typeof(Brush), typeof(MarkdownTextBlock), new PropertyMetadata(null, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty QuoteBorderBrushProperty =
+ DependencyProperty.Register(nameof(QuoteBorderBrush), typeof(Brush), typeof(MarkdownTextBlock), new PropertyMetadata(null, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty QuoteForegroundProperty =
+ DependencyProperty.Register(nameof(QuoteForeground), typeof(Brush), typeof(MarkdownTextBlock), new PropertyMetadata(null, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty QuoteBorderThicknessProperty =
+ DependencyProperty.Register(nameof(QuoteBorderThickness), typeof(Thickness), typeof(MarkdownTextBlock), new PropertyMetadata(default(Thickness), OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty QuoteMarginProperty =
+ DependencyProperty.Register(nameof(QuoteMargin), typeof(Thickness), typeof(MarkdownTextBlock), new PropertyMetadata(default(Thickness), OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty QuotePaddingProperty =
+ DependencyProperty.Register(nameof(QuotePadding), typeof(Thickness), typeof(MarkdownTextBlock), new PropertyMetadata(default(Thickness), OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty QuoteBarMarginProperty =
+ DependencyProperty.Register(nameof(QuoteBarMargin), typeof(Thickness), typeof(MarkdownTextBlock), new PropertyMetadata(default(Thickness), OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty QuoteCornerRadiusProperty =
+ DependencyProperty.Register(nameof(QuoteCornerRadius), typeof(CornerRadius), typeof(MarkdownTextBlock), new PropertyMetadata(default(CornerRadius), OnThemePropertyChanged));
+
+ // ── Image ───────────────────────────────────────────────────────────
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty ImageMaxWidthProperty =
+ DependencyProperty.Register(nameof(ImageMaxWidth), typeof(double), typeof(MarkdownTextBlock), new PropertyMetadata(0d, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty ImageMaxHeightProperty =
+ DependencyProperty.Register(nameof(ImageMaxHeight), typeof(double), typeof(MarkdownTextBlock), new PropertyMetadata(0d, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty ImageStretchProperty =
+ DependencyProperty.Register(nameof(ImageStretch), typeof(Stretch), typeof(MarkdownTextBlock), new PropertyMetadata(default(Stretch), OnThemePropertyChanged));
+
+ // ── Table ───────────────────────────────────────────────────────────
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty TableHeadingBackgroundProperty =
+ DependencyProperty.Register(nameof(TableHeadingBackground), typeof(Brush), typeof(MarkdownTextBlock), new PropertyMetadata(null, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty TableBorderBrushProperty =
+ DependencyProperty.Register(nameof(TableBorderBrush), typeof(Brush), typeof(MarkdownTextBlock), new PropertyMetadata(null, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty TableBorderThicknessProperty =
+ DependencyProperty.Register(nameof(TableBorderThickness), typeof(double), typeof(MarkdownTextBlock), new PropertyMetadata(0d, OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty TableCellPaddingProperty =
+ DependencyProperty.Register(nameof(TableCellPadding), typeof(Thickness), typeof(MarkdownTextBlock), new PropertyMetadata(default(Thickness), OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty TableMarginProperty =
+ DependencyProperty.Register(nameof(TableMargin), typeof(Thickness), typeof(MarkdownTextBlock), new PropertyMetadata(default(Thickness), OnThemePropertyChanged));
+
+ ///
+ /// Identifies the dependency property.
+ ///
+ public static readonly DependencyProperty TableCornerRadiusProperty =
+ DependencyProperty.Register(nameof(TableCornerRadius), typeof(CornerRadius), typeof(MarkdownTextBlock), new PropertyMetadata(default(CornerRadius), OnThemePropertyChanged));
+
+ // ── CLR property wrappers ───────────────────────────────────────────
+
+ /// Gets or sets the base URL for resolving relative links.
+ public string? BaseUrl
+ {
+ get => (string?)GetValue(BaseUrlProperty);
+ set => SetValue(BaseUrlProperty, value);
+ }
+
+ /// Gets or sets the custom image provider.
+ public IImageProvider? ImageProvider
{
- get => (MarkdownConfig)GetValue(ConfigProperty);
- set => SetValue(ConfigProperty, value);
+ get => (IImageProvider?)GetValue(ImageProviderProperty);
+ set => SetValue(ImageProviderProperty, value);
+ }
+
+ /// Gets or sets the SVG renderer.
+ public ISVGRenderer? SVGRenderer
+ {
+ get => (ISVGRenderer?)GetValue(SVGRendererProperty);
+ set => SetValue(SVGRendererProperty, value);
}
///
@@ -229,4 +716,151 @@ public bool IsTextSelectionEnabled
get => (bool)GetValue(IsTextSelectionEnabledProperty);
set => SetValue(IsTextSelectionEnabledProperty, value);
}
+
+ // ── Theme property CLR wrappers ─────────────────────────────────────
+
+ /// Gets or sets the font size for H1 headings.
+ public double H1FontSize { get => (double)GetValue(H1FontSizeProperty); set => SetValue(H1FontSizeProperty, value); }
+ /// Gets or sets the font size for H2 headings.
+ public double H2FontSize { get => (double)GetValue(H2FontSizeProperty); set => SetValue(H2FontSizeProperty, value); }
+ /// Gets or sets the font size for H3 headings.
+ public double H3FontSize { get => (double)GetValue(H3FontSizeProperty); set => SetValue(H3FontSizeProperty, value); }
+ /// Gets or sets the font size for H4 headings.
+ public double H4FontSize { get => (double)GetValue(H4FontSizeProperty); set => SetValue(H4FontSizeProperty, value); }
+ /// Gets or sets the font size for H5 headings.
+ public double H5FontSize { get => (double)GetValue(H5FontSizeProperty); set => SetValue(H5FontSizeProperty, value); }
+ /// Gets or sets the font size for H6 headings.
+ public double H6FontSize { get => (double)GetValue(H6FontSizeProperty); set => SetValue(H6FontSizeProperty, value); }
+
+ /// Gets or sets the foreground brush for H1 headings.
+ public Brush H1Foreground { get => (Brush)GetValue(H1ForegroundProperty); set => SetValue(H1ForegroundProperty, value); }
+ /// Gets or sets the foreground brush for H2 headings.
+ public Brush H2Foreground { get => (Brush)GetValue(H2ForegroundProperty); set => SetValue(H2ForegroundProperty, value); }
+ /// Gets or sets the foreground brush for H3 headings.
+ public Brush H3Foreground { get => (Brush)GetValue(H3ForegroundProperty); set => SetValue(H3ForegroundProperty, value); }
+ /// Gets or sets the foreground brush for H4 headings.
+ public Brush H4Foreground { get => (Brush)GetValue(H4ForegroundProperty); set => SetValue(H4ForegroundProperty, value); }
+ /// Gets or sets the foreground brush for H5 headings.
+ public Brush H5Foreground { get => (Brush)GetValue(H5ForegroundProperty); set => SetValue(H5ForegroundProperty, value); }
+ /// Gets or sets the foreground brush for H6 headings.
+ public Brush H6Foreground { get => (Brush)GetValue(H6ForegroundProperty); set => SetValue(H6ForegroundProperty, value); }
+
+ /// Gets or sets the font weight for H1 headings.
+ public FontWeight H1FontWeight { get => (FontWeight)GetValue(H1FontWeightProperty); set => SetValue(H1FontWeightProperty, value); }
+ /// Gets or sets the font weight for H2 headings.
+ public FontWeight H2FontWeight { get => (FontWeight)GetValue(H2FontWeightProperty); set => SetValue(H2FontWeightProperty, value); }
+ /// Gets or sets the font weight for H3 headings.
+ public FontWeight H3FontWeight { get => (FontWeight)GetValue(H3FontWeightProperty); set => SetValue(H3FontWeightProperty, value); }
+ /// Gets or sets the font weight for H4 headings.
+ public FontWeight H4FontWeight { get => (FontWeight)GetValue(H4FontWeightProperty); set => SetValue(H4FontWeightProperty, value); }
+ /// Gets or sets the font weight for H5 headings.
+ public FontWeight H5FontWeight { get => (FontWeight)GetValue(H5FontWeightProperty); set => SetValue(H5FontWeightProperty, value); }
+ /// Gets or sets the font weight for H6 headings.
+ public FontWeight H6FontWeight { get => (FontWeight)GetValue(H6FontWeightProperty); set => SetValue(H6FontWeightProperty, value); }
+
+ /// Gets or sets the margin for H1 headings.
+ public Thickness H1Margin { get => (Thickness)GetValue(H1MarginProperty); set => SetValue(H1MarginProperty, value); }
+ /// Gets or sets the margin for H2 headings.
+ public Thickness H2Margin { get => (Thickness)GetValue(H2MarginProperty); set => SetValue(H2MarginProperty, value); }
+ /// Gets or sets the margin for H3 headings.
+ public Thickness H3Margin { get => (Thickness)GetValue(H3MarginProperty); set => SetValue(H3MarginProperty, value); }
+ /// Gets or sets the margin for H4 headings.
+ public Thickness H4Margin { get => (Thickness)GetValue(H4MarginProperty); set => SetValue(H4MarginProperty, value); }
+ /// Gets or sets the margin for H5 headings.
+ public Thickness H5Margin { get => (Thickness)GetValue(H5MarginProperty); set => SetValue(H5MarginProperty, value); }
+ /// Gets or sets the margin for H6 headings.
+ public Thickness H6Margin { get => (Thickness)GetValue(H6MarginProperty); set => SetValue(H6MarginProperty, value); }
+
+ /// Gets or sets the background brush for inline code.
+ public Brush InlineCodeBackground { get => (Brush)GetValue(InlineCodeBackgroundProperty); set => SetValue(InlineCodeBackgroundProperty, value); }
+ /// Gets or sets the foreground brush for inline code.
+ public Brush InlineCodeForeground { get => (Brush)GetValue(InlineCodeForegroundProperty); set => SetValue(InlineCodeForegroundProperty, value); }
+ /// Gets or sets the border brush for inline code.
+ public Brush InlineCodeBorderBrush { get => (Brush)GetValue(InlineCodeBorderBrushProperty); set => SetValue(InlineCodeBorderBrushProperty, value); }
+ /// Gets or sets the border thickness for inline code.
+ public Thickness InlineCodeBorderThickness { get => (Thickness)GetValue(InlineCodeBorderThicknessProperty); set => SetValue(InlineCodeBorderThicknessProperty, value); }
+ /// Gets or sets the corner radius for inline code.
+ public CornerRadius InlineCodeCornerRadius { get => (CornerRadius)GetValue(InlineCodeCornerRadiusProperty); set => SetValue(InlineCodeCornerRadiusProperty, value); }
+ /// Gets or sets the padding for inline code.
+ public Thickness InlineCodePadding { get => (Thickness)GetValue(InlineCodePaddingProperty); set => SetValue(InlineCodePaddingProperty, value); }
+ /// Gets or sets the font size for inline code.
+ public double InlineCodeFontSize { get => (double)GetValue(InlineCodeFontSizeProperty); set => SetValue(InlineCodeFontSizeProperty, value); }
+ /// Gets or sets the font weight for inline code.
+ public FontWeight InlineCodeFontWeight { get => (FontWeight)GetValue(InlineCodeFontWeightProperty); set => SetValue(InlineCodeFontWeightProperty, value); }
+
+ /// Gets or sets the font weight used for bold text.
+ public FontWeight BoldFontWeight { get => (FontWeight)GetValue(BoldFontWeightProperty); set => SetValue(BoldFontWeightProperty, value); }
+
+ /// Gets or sets the background brush for code blocks.
+ public Brush CodeBlockBackground { get => (Brush)GetValue(CodeBlockBackgroundProperty); set => SetValue(CodeBlockBackgroundProperty, value); }
+ /// Gets or sets the border brush for code blocks.
+ public Brush CodeBlockBorderBrush { get => (Brush)GetValue(CodeBlockBorderBrushProperty); set => SetValue(CodeBlockBorderBrushProperty, value); }
+ /// Gets or sets the foreground brush for code blocks.
+ public Brush CodeBlockForeground { get => (Brush)GetValue(CodeBlockForegroundProperty); set => SetValue(CodeBlockForegroundProperty, value); }
+ /// Gets or sets the border thickness for code blocks.
+ public Thickness CodeBlockBorderThickness { get => (Thickness)GetValue(CodeBlockBorderThicknessProperty); set => SetValue(CodeBlockBorderThicknessProperty, value); }
+ /// Gets or sets the padding for code blocks.
+ public Thickness CodeBlockPadding { get => (Thickness)GetValue(CodeBlockPaddingProperty); set => SetValue(CodeBlockPaddingProperty, value); }
+ /// Gets or sets the margin for code blocks.
+ public Thickness CodeBlockMargin { get => (Thickness)GetValue(CodeBlockMarginProperty); set => SetValue(CodeBlockMarginProperty, value); }
+ /// Gets or sets the font family for code blocks.
+ public FontFamily CodeBlockFontFamily { get => (FontFamily)GetValue(CodeBlockFontFamilyProperty); set => SetValue(CodeBlockFontFamilyProperty, value); }
+ /// Gets or sets the corner radius for code blocks.
+ public CornerRadius CodeBlockCornerRadius { get => (CornerRadius)GetValue(CodeBlockCornerRadiusProperty); set => SetValue(CodeBlockCornerRadiusProperty, value); }
+
+ /// Gets or sets the brush for horizontal rules.
+ public Brush HorizontalRuleBrush { get => (Brush)GetValue(HorizontalRuleBrushProperty); set => SetValue(HorizontalRuleBrushProperty, value); }
+ /// Gets or sets the thickness of horizontal rules.
+ public double HorizontalRuleThickness { get => (double)GetValue(HorizontalRuleThicknessProperty); set => SetValue(HorizontalRuleThicknessProperty, value); }
+ /// Gets or sets the margin around horizontal rules.
+ public Thickness HorizontalRuleMargin { get => (Thickness)GetValue(HorizontalRuleMarginProperty); set => SetValue(HorizontalRuleMarginProperty, value); }
+
+ /// Gets or sets the foreground brush for hyperlinks.
+ public Brush LinkForeground { get => (Brush)GetValue(LinkForegroundProperty); set => SetValue(LinkForegroundProperty, value); }
+
+ /// Gets or sets the margin for paragraphs.
+ public Thickness ParagraphMargin { get => (Thickness)GetValue(ParagraphMarginProperty); set => SetValue(ParagraphMarginProperty, value); }
+ /// Gets or sets the line height for paragraphs.
+ public double ParagraphLineHeight { get => (double)GetValue(ParagraphLineHeightProperty); set => SetValue(ParagraphLineHeightProperty, value); }
+ /// Gets or sets the spacing after list bullets.
+ public double ListBulletSpacing { get => (double)GetValue(ListBulletSpacingProperty); set => SetValue(ListBulletSpacingProperty, value); }
+ /// Gets or sets the gutter width for list indentation.
+ public double ListGutterWidth { get => (double)GetValue(ListGutterWidthProperty); set => SetValue(ListGutterWidthProperty, value); }
+
+ /// Gets or sets the background brush for block quotes.
+ public Brush QuoteBackground { get => (Brush)GetValue(QuoteBackgroundProperty); set => SetValue(QuoteBackgroundProperty, value); }
+ /// Gets or sets the border brush for block quotes.
+ public Brush QuoteBorderBrush { get => (Brush)GetValue(QuoteBorderBrushProperty); set => SetValue(QuoteBorderBrushProperty, value); }
+ /// Gets or sets the foreground brush for block quotes.
+ public Brush QuoteForeground { get => (Brush)GetValue(QuoteForegroundProperty); set => SetValue(QuoteForegroundProperty, value); }
+ /// Gets or sets the border thickness for block quotes.
+ public Thickness QuoteBorderThickness { get => (Thickness)GetValue(QuoteBorderThicknessProperty); set => SetValue(QuoteBorderThicknessProperty, value); }
+ /// Gets or sets the margin for block quotes.
+ public Thickness QuoteMargin { get => (Thickness)GetValue(QuoteMarginProperty); set => SetValue(QuoteMarginProperty, value); }
+ /// Gets or sets the padding for block quotes.
+ public Thickness QuotePadding { get => (Thickness)GetValue(QuotePaddingProperty); set => SetValue(QuotePaddingProperty, value); }
+ /// Gets or sets the corner radius for block quotes.
+ public CornerRadius QuoteCornerRadius { get => (CornerRadius)GetValue(QuoteCornerRadiusProperty); set => SetValue(QuoteCornerRadiusProperty, value); }
+ /// Gets or sets the margin for the quote bar indicator.
+ public Thickness QuoteBarMargin { get => (Thickness)GetValue(QuoteBarMarginProperty); set => SetValue(QuoteBarMarginProperty, value); }
+
+ /// Gets or sets the maximum width for images.
+ public double ImageMaxWidth { get => (double)GetValue(ImageMaxWidthProperty); set => SetValue(ImageMaxWidthProperty, value); }
+ /// Gets or sets the maximum height for images.
+ public double ImageMaxHeight { get => (double)GetValue(ImageMaxHeightProperty); set => SetValue(ImageMaxHeightProperty, value); }
+ /// Gets or sets the stretch mode for images.
+ public Stretch ImageStretch { get => (Stretch)GetValue(ImageStretchProperty); set => SetValue(ImageStretchProperty, value); }
+
+ /// Gets or sets the background brush for table headings.
+ public Brush TableHeadingBackground { get => (Brush)GetValue(TableHeadingBackgroundProperty); set => SetValue(TableHeadingBackgroundProperty, value); }
+ /// Gets or sets the border brush for tables.
+ public Brush TableBorderBrush { get => (Brush)GetValue(TableBorderBrushProperty); set => SetValue(TableBorderBrushProperty, value); }
+ /// Gets or sets the border thickness for tables.
+ public double TableBorderThickness { get => (double)GetValue(TableBorderThicknessProperty); set => SetValue(TableBorderThicknessProperty, value); }
+ /// Gets or sets the cell padding for tables.
+ public Thickness TableCellPadding { get => (Thickness)GetValue(TableCellPaddingProperty); set => SetValue(TableCellPaddingProperty, value); }
+ /// Gets or sets the margin for tables.
+ public Thickness TableMargin { get => (Thickness)GetValue(TableMarginProperty); set => SetValue(TableMarginProperty, value); }
+ /// Gets or sets the corner radius for tables.
+ public CornerRadius TableCornerRadius { get => (CornerRadius)GetValue(TableCornerRadiusProperty); set => SetValue(TableCornerRadiusProperty, value); }
}
diff --git a/components/MarkdownTextBlock/src/MarkdownTextBlock.xaml b/components/MarkdownTextBlock/src/MarkdownTextBlock.xaml
index 8b187a5ac..f2596f06b 100644
--- a/components/MarkdownTextBlock/src/MarkdownTextBlock.xaml
+++ b/components/MarkdownTextBlock/src/MarkdownTextBlock.xaml
@@ -1,12 +1,238 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+