Files
Wino-Mail/Wino.Mail.ViewModels/WelcomePageViewModel.cs

39 lines
1.3 KiB
C#
Raw Normal View History

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;
namespace Wino.Mail.ViewModels
2024-04-18 01:44:37 +02:00
{
public partial class WelcomePageViewModel : MailBaseViewModel
2024-04-18 01:44:37 +02:00
{
public const string VersionFile = "190.md";
private readonly IMailDialogService _dialogService;
private readonly IFileService _fileService;
2024-04-18 01:44:37 +02:00
[ObservableProperty]
private string currentVersionNotes;
2024-04-18 01:44:37 +02:00
public WelcomePageViewModel(IMailDialogService dialogService, IFileService fileService)
2024-04-18 01:44:37 +02:00
{
_dialogService = dialogService;
_fileService = fileService;
2024-04-18 01:44:37 +02:00
}
public override async void OnNavigatedTo(NavigationMode mode, object parameters)
2024-04-18 01:44:37 +02:00
{
base.OnNavigatedTo(mode, parameters);
try
{
CurrentVersionNotes = await _fileService.GetFileContentByApplicationUriAsync($"ms-appx:///Assets/ReleaseNotes/{VersionFile}");
}
catch (Exception)
{
_dialogService.InfoBarMessage(Translator.GeneralTitle_Error, "Can't find the patch notes.", Core.Domain.Enums.InfoBarMessageType.Information);
}
2024-04-18 01:44:37 +02:00
}
}
}