2024-04-18 01:44:37 +02:00
|
|
|
|
using System;
|
|
|
|
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
|
|
|
using Wino.Core.Domain;
|
|
|
|
|
|
using Wino.Core.Domain.Interfaces;
|
|
|
|
|
|
using Wino.Core.Domain.Models.Navigation;
|
|
|
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
|
namespace Wino.Mail.ViewModels;
|
|
|
|
|
|
|
|
|
|
|
|
public partial class WelcomePageViewModel : MailBaseViewModel
|
2024-04-18 01:44:37 +02:00
|
|
|
|
{
|
2025-02-23 20:58:33 +01:00
|
|
|
|
public const string VersionFile = "1102.md";
|
2025-02-16 11:54:23 +01:00
|
|
|
|
private readonly IMailDialogService _dialogService;
|
|
|
|
|
|
private readonly IFileService _fileService;
|
|
|
|
|
|
|
|
|
|
|
|
[ObservableProperty]
|
|
|
|
|
|
private string currentVersionNotes;
|
|
|
|
|
|
|
|
|
|
|
|
public WelcomePageViewModel(IMailDialogService dialogService, IFileService fileService)
|
2024-04-18 01:44:37 +02:00
|
|
|
|
{
|
2025-02-16 11:54:23 +01:00
|
|
|
|
_dialogService = dialogService;
|
|
|
|
|
|
_fileService = fileService;
|
|
|
|
|
|
}
|
2024-04-18 01:44:37 +02:00
|
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
|
public override async void OnNavigatedTo(NavigationMode mode, object parameters)
|
|
|
|
|
|
{
|
|
|
|
|
|
base.OnNavigatedTo(mode, parameters);
|
2024-04-18 01:44:37 +02:00
|
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
|
try
|
2024-04-18 01:44:37 +02:00
|
|
|
|
{
|
2025-02-16 11:54:23 +01:00
|
|
|
|
CurrentVersionNotes = await _fileService.GetFileContentByApplicationUriAsync($"ms-appx:///Assets/ReleaseNotes/{VersionFile}");
|
2024-04-18 01:44:37 +02:00
|
|
|
|
}
|
2025-02-16 11:54:23 +01:00
|
|
|
|
catch (Exception)
|
2024-04-18 01:44:37 +02:00
|
|
|
|
{
|
2025-02-16 11:54:23 +01:00
|
|
|
|
_dialogService.InfoBarMessage(Translator.GeneralTitle_Error, "Can't find the patch notes.", Core.Domain.Enums.InfoBarMessageType.Information);
|
2024-04-18 01:44:37 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|