From 6f55edbacf68a562a5499f961340eaa28af2e8bc Mon Sep 17 00:00:00 2001 From: Liam Sho Date: Sun, 22 May 2022 14:38:44 +0800 Subject: [PATCH] =?UTF-8?q?feat.=E6=9B=B4=E6=96=B0=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=94=AF=E6=8C=81=20Markdown=20=E6=B8=B2?= =?UTF-8?q?=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MeoAsstGui/MeoAsstGui.csproj | 3 +++ .../ViewModels/VersionUpdateViewModel.cs | 18 ++++++++++++++++++ src/MeoAsstGui/Views/VersionUpdateView.xaml | 18 +++++++++++++++--- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/MeoAsstGui/MeoAsstGui.csproj b/src/MeoAsstGui/MeoAsstGui.csproj index fe9581f252..fe34dacb65 100644 --- a/src/MeoAsstGui/MeoAsstGui.csproj +++ b/src/MeoAsstGui/MeoAsstGui.csproj @@ -258,6 +258,9 @@ 4.3.0 + + 1.0.10 + 2.0.3 diff --git a/src/MeoAsstGui/ViewModels/VersionUpdateViewModel.cs b/src/MeoAsstGui/ViewModels/VersionUpdateViewModel.cs index 9921236610..8f04c354e6 100644 --- a/src/MeoAsstGui/ViewModels/VersionUpdateViewModel.cs +++ b/src/MeoAsstGui/ViewModels/VersionUpdateViewModel.cs @@ -18,6 +18,9 @@ using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; using System.Windows; +using System.Windows.Documents; +using Markdig; +using Neo.Markdig.Xaml; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Stylet; @@ -58,6 +61,8 @@ namespace MeoAsstGui private string _updateInfo = ViewStatusStorage.Get("VersionUpdate.body", string.Empty); + private static readonly MarkdownPipeline s_markdownPipeline = new MarkdownPipelineBuilder().UseXamlSupportedExtensions().Build(); + public string UpdateInfo { get @@ -71,6 +76,14 @@ namespace MeoAsstGui } } + public FlowDocument UpdateInfoDocument + { + get + { + return MarkdownXaml.ToFlowDocument(UpdateInfo, s_markdownPipeline); + } + } + private bool _isFirstBootAfterUpdate = Convert.ToBoolean(ViewStatusStorage.Get("VersionUpdate.firstboot", Boolean.FalseString)); public bool IsFirstBootAfterUpdate @@ -735,5 +748,10 @@ namespace MeoAsstGui UpdateTag = string.Empty; UpdateInfo = string.Empty; } + + public void OpenHyperlink(object sender, System.Windows.Input.ExecutedRoutedEventArgs e) + { + Process.Start(e.Parameter.ToString()); + } } } diff --git a/src/MeoAsstGui/Views/VersionUpdateView.xaml b/src/MeoAsstGui/Views/VersionUpdateView.xaml index c89ba27611..30de8c3bc1 100644 --- a/src/MeoAsstGui/Views/VersionUpdateView.xaml +++ b/src/MeoAsstGui/Views/VersionUpdateView.xaml @@ -4,6 +4,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:s="https://github.com/canton7/Stylet" + xmlns:md="clr-namespace:Neo.Markdig.Xaml;assembly=Neo.Markdig.Xaml" mc:Ignorable="d" Title="版本已更新" Height="500" Width="600"> @@ -17,9 +18,20 @@ - - - + + + + + +