mirror of
https://github.com/yaobiao131/downkyicore.git
synced 2025-08-10 00:52:31 +00:00
feat: 加入版本检测
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
using Avalonia.Controls.Documents;
|
||||
using DownKyi.Models;
|
||||
using DownKyi.Utils;
|
||||
using Prism.Commands;
|
||||
using Prism.Services.Dialogs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DownKyi.ViewModels.Dialogs
|
||||
{
|
||||
public class NewVersionAvailableDialogViewModel : BaseDialogViewModel
|
||||
{
|
||||
public const string Tag = "NewVersionAvailable";
|
||||
|
||||
private DelegateCommand? _allowCommand;
|
||||
public DelegateCommand AllowCommand => _allowCommand ??= new DelegateCommand(ExecuteAllowCommand);
|
||||
|
||||
/// <summary>
|
||||
/// 确认事件
|
||||
/// </summary>
|
||||
private void ExecuteAllowCommand()
|
||||
{
|
||||
ButtonResult result = ButtonResult.OK;
|
||||
RaiseRequestClose(new DialogResult(result));
|
||||
}
|
||||
|
||||
public ObservableCollection<Run> Messages { get; set; } = new();
|
||||
|
||||
|
||||
public override void OnDialogOpened(IDialogParameters parameters)
|
||||
{
|
||||
Messages.AddRange(MarkdownUtil.ConvertMarkdownToRuns(parameters.GetValue<string>("body")));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user