From f43c07ba8058e1397a7870aa5d94ec102146a2e6 Mon Sep 17 00:00:00 2001 From: zzyyyl Date: Sun, 5 Mar 2023 15:58:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=20changelog=20?= =?UTF-8?q?=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaWpfGui/Main/VersionUpdateViewModel.cs | 6 +++ src/MaaWpfGui/Views/VersionUpdateView.xaml | 57 ++++++++++---------- 2 files changed, 35 insertions(+), 28 deletions(-) diff --git a/src/MaaWpfGui/Main/VersionUpdateViewModel.cs b/src/MaaWpfGui/Main/VersionUpdateViewModel.cs index 391ee38426..01f03d8d67 100644 --- a/src/MaaWpfGui/Main/VersionUpdateViewModel.cs +++ b/src/MaaWpfGui/Main/VersionUpdateViewModel.cs @@ -22,7 +22,10 @@ using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; using System.Windows; +using System.Windows.Documents; using MaaWpfGui.Helper; +using Markdig; +using Neo.Markdig.Xaml; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Stylet; @@ -108,6 +111,9 @@ namespace MaaWpfGui } } + public FlowDocument UpdateInfoDoc => MarkdownXaml.ToFlowDocument(UpdateInfo, + new MarkdownPipelineBuilder().UseXamlSupportedExtensions().Build()); + private string _updateUrl; /// diff --git a/src/MaaWpfGui/Views/VersionUpdateView.xaml b/src/MaaWpfGui/Views/VersionUpdateView.xaml index ac1532a6a0..4ebcb3a7b0 100644 --- a/src/MaaWpfGui/Views/VersionUpdateView.xaml +++ b/src/MaaWpfGui/Views/VersionUpdateView.xaml @@ -5,7 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:maa="clr-namespace:MaaWpfGui.Helper.CustomStyle" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:mdxam="clr-namespace:MdXaml;assembly=MdXaml" + xmlns:mdg="clr-namespace:Neo.Markdig.Xaml;assembly=Neo.Markdig.Xaml" xmlns:s="https://github.com/canton7/Stylet" xmlns:vm="clr-namespace:MaaWpfGui" Title="{DynamicResource VersionUpdated}" @@ -15,9 +15,9 @@ mc:Ignorable="d"> - + - + + TextWrapping="Wrap" VerticalAlignment="Bottom" /> + TextWrapping="Wrap" VerticalAlignment="Bottom" /> - - + Zoom="90" + IsSelectionEnabled="False"> + + + + + + + - - - -