From 4cfb02ce3e21d7559b3f57d997fe7377b8a0dee6 Mon Sep 17 00:00:00 2001 From: MistEO Date: Sun, 8 Oct 2023 21:12:53 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"feat:=20=E4=BD=BF=E7=94=A8MdXaml?= =?UTF-8?q?=E6=9D=A5=E6=8F=90=E5=8D=87Markdown=E6=B8=B2=E6=9F=93=E8=A1=A8?= =?UTF-8?q?=E7=8E=B0"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaWpfGui/MaaWpfGui.csproj | 9 ++-- .../ViewModels/UI/AnnouncementViewModel.cs | 5 ++ .../ViewModels/UI/VersionUpdateViewModel.cs | 4 ++ src/MaaWpfGui/Views/UI/AnnouncementView.xaml | 51 +++++++++++-------- src/MaaWpfGui/Views/UI/VersionUpdateView.xaml | 51 +++++++++++++------ 5 files changed, 80 insertions(+), 40 deletions(-) diff --git a/src/MaaWpfGui/MaaWpfGui.csproj b/src/MaaWpfGui/MaaWpfGui.csproj index 07f2b4062c..636ef46c63 100644 --- a/src/MaaWpfGui/MaaWpfGui.csproj +++ b/src/MaaWpfGui/MaaWpfGui.csproj @@ -107,12 +107,15 @@ 3.4.5 - - - + + 1.15.0 + 7.1.2 + + 0.5.0.1 + 13.0.1 diff --git a/src/MaaWpfGui/ViewModels/UI/AnnouncementViewModel.cs b/src/MaaWpfGui/ViewModels/UI/AnnouncementViewModel.cs index dc8b8b4749..c115ecf40e 100644 --- a/src/MaaWpfGui/ViewModels/UI/AnnouncementViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/AnnouncementViewModel.cs @@ -17,6 +17,8 @@ using System.Windows.Documents; using System.Windows.Input; using MaaWpfGui.Constants; using MaaWpfGui.Helper; +using Markdig; +using Markdig.Wpf; using Stylet; namespace MaaWpfGui.ViewModels.UI @@ -56,6 +58,9 @@ namespace MaaWpfGui.ViewModels.UI } } + public FlowDocument AnnouncementInfoDoc => Markdig.Wpf.Markdown.ToFlowDocument(AnnouncementInfo, + new MarkdownPipelineBuilder().UseSupportedExtensions().Build()); + /// /// 检查更新 /// diff --git a/src/MaaWpfGui/ViewModels/UI/VersionUpdateViewModel.cs b/src/MaaWpfGui/ViewModels/UI/VersionUpdateViewModel.cs index 2bc4a4a312..2f73692316 100644 --- a/src/MaaWpfGui/ViewModels/UI/VersionUpdateViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/VersionUpdateViewModel.cs @@ -29,6 +29,8 @@ using MaaWpfGui.Helper; using MaaWpfGui.Main; using MaaWpfGui.Models; using MaaWpfGui.States; +using Markdig; +using Markdig.Wpf; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Semver; @@ -114,6 +116,8 @@ namespace MaaWpfGui.ViewModels.UI } } + public FlowDocument UpdateInfoDoc => Markdig.Wpf.Markdown.ToFlowDocument(UpdateInfo, + new MarkdownPipelineBuilder().UseSupportedExtensions().Build()); private string _updateUrl; diff --git a/src/MaaWpfGui/Views/UI/AnnouncementView.xaml b/src/MaaWpfGui/Views/UI/AnnouncementView.xaml index 9c1aba7adf..d8d3c7e710 100644 --- a/src/MaaWpfGui/Views/UI/AnnouncementView.xaml +++ b/src/MaaWpfGui/Views/UI/AnnouncementView.xaml @@ -4,10 +4,9 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:hc="https://handyorg.github.io/handycontrol" + xmlns:markdig="clr-namespace:Markdig.Wpf;assembly=Markdig.Wpf" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:mdxam="clr-namespace:MdXaml;assembly=MdXaml" - xmlns:mdplug="clr-namespace:MdXaml.Plugins;assembly=MdXaml.Plugins" - xmlns:mdhtml="clr-namespace:MdXaml.Html;assembly=MdXaml.Html" + xmlns:s="https://github.com/canton7/Stylet" xmlns:ui="clr-namespace:MaaWpfGui.ViewModels.UI" Title="{DynamicResource Announcement}" Width="600" @@ -20,25 +19,35 @@ - - - - - - - - - - + Document="{Binding AnnouncementInfoDoc}" + Zoom="90"> + + + + + + + + + + + + + - \ No newline at end of file + diff --git a/src/MaaWpfGui/Views/UI/VersionUpdateView.xaml b/src/MaaWpfGui/Views/UI/VersionUpdateView.xaml index c3a1251f3c..77c9970f3c 100644 --- a/src/MaaWpfGui/Views/UI/VersionUpdateView.xaml +++ b/src/MaaWpfGui/Views/UI/VersionUpdateView.xaml @@ -5,8 +5,10 @@ xmlns:controls="clr-namespace:MaaWpfGui.Styles.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:hc="https://handyorg.github.io/handycontrol" + xmlns:markdig="clr-namespace:Markdig.Wpf;assembly=Markdig.Wpf" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:mdxam="clr-namespace:MdXaml;assembly=MdXaml" + xmlns:s="https://github.com/canton7/Stylet" + xmlns:styles="clr-namespace:MaaWpfGui.Styles" xmlns:ui="clr-namespace:MaaWpfGui.ViewModels.UI" xmlns:viewModels="clr-namespace:MaaWpfGui.ViewModels" xmlns:vm="clr-namespace:MaaWpfGui" @@ -27,14 +29,14 @@ HorizontalAlignment="Center" Orientation="Horizontal"> - - - - - + Margin="16,0" + Document="{Binding UpdateInfoDoc}" + IsSelectionEnabled="False" + Zoom="90"> + + + + + + + + + + + + + - \ No newline at end of file +