Add mdxaml plugins

This commit is contained in:
Jack251970 2025-06-07 11:11:40 +08:00
parent eee57e29d0
commit 458a8b3efb
3 changed files with 16 additions and 1 deletions

View file

@ -91,6 +91,10 @@
</PackageReference>
<PackageReference Include="InputSimulator" Version="1.0.4" />
<PackageReference Include="MdXaml" Version="1.27.0" />
<PackageReference Include="MdXaml.AnimatedGif" Version="1.27.0" />
<PackageReference Include="MdXaml.Html" Version="1.27.0" />
<PackageReference Include="MdXaml.Plugins" Version="1.27.0" />
<PackageReference Include="MdXaml.Svg" Version="1.27.0" />
<!-- Do not upgrade Microsoft.Extensions.DependencyInjection and Microsoft.Extensions.Hosting since we are .Net7.0 -->
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />

View file

@ -163,7 +163,8 @@
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
ClickAction="SafetyDisplayWithRelativePath"
Loaded="MarkdownViewer_Loaded" />
Loaded="MarkdownViewer_Loaded"
Plugins="{StaticResource MdXamlPlugins}" />
<!-- Put this Grid in the same position as MarkdownViewer -->
<Grid

View file

@ -1,6 +1,10 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mdagif="clr-namespace:MdXaml.AnimatedGif;assembly=MdXaml.AnimatedGif"
xmlns:mdhtml="clr-namespace:MdXaml.Html;assembly=MdXaml.Html"
xmlns:mdplugins="clr-namespace:MdXaml.Plugins;assembly=MdXaml.Plugins"
xmlns:mdsvg="clr-namespace:MdXaml.Svg;assembly=MdXaml.Svg"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:ui="http://schemas.modernwpf.com/2019">
@ -5761,6 +5765,12 @@
</Style>
<!-- Release Notes -->
<mdplugins:MdXamlPlugins x:Key="MdXamlPlugins">
<mdhtml:HtmlPluginSetup />
<mdsvg:SvgPluginSetup />
<mdagif:AnimatedGifPluginSetup />
</mdplugins:MdXamlPlugins>
<Style x:Key="DocumentStyleGithubLikeLight" TargetType="FlowDocument">
<Setter Property="FontFamily" Value="Calibri" />
<Setter Property="TextAlignment" Value="Left" />