Files
Wino-Mail/Wino.Mail.ViewModels/WelcomePageViewModel.cs
Burak Kaan Köse cf9869b71e Revert "File scoped namespaces"
This reverts commit d31d8f574e.
2025-02-16 11:43:30 +01:00

39 lines
1.3 KiB
C#

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
{
public partial class WelcomePageViewModel : MailBaseViewModel
{
public const string VersionFile = "190.md";
private readonly IMailDialogService _dialogService;
private readonly IFileService _fileService;
[ObservableProperty]
private string currentVersionNotes;
public WelcomePageViewModel(IMailDialogService dialogService, IFileService fileService)
{
_dialogService = dialogService;
_fileService = fileService;
}
public override async void OnNavigatedTo(NavigationMode mode, object parameters)
{
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);
}
}
}
}