2026-03-05 10:12:03 +01:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
|
|
using CommunityToolkit.Mvvm.Input;
|
|
|
|
|
using CommunityToolkit.Mvvm.Messaging;
|
2026-03-06 03:42:08 +01:00
|
|
|
using Wino.Core.Domain;
|
|
|
|
|
using Wino.Core.Domain.Enums;
|
2026-03-05 10:12:03 +01:00
|
|
|
using Wino.Core.Domain.Interfaces;
|
|
|
|
|
using Wino.Core.Domain.Models.Navigation;
|
|
|
|
|
using Wino.Core.Domain.Models.Updates;
|
|
|
|
|
using Wino.Messaging.Client.Navigation;
|
|
|
|
|
|
|
|
|
|
namespace Wino.Mail.ViewModels;
|
|
|
|
|
|
|
|
|
|
public partial class WelcomePageV2ViewModel : MailBaseViewModel
|
|
|
|
|
{
|
|
|
|
|
private readonly IUpdateManager _updateManager;
|
|
|
|
|
|
|
|
|
|
[ObservableProperty]
|
|
|
|
|
public partial List<UpdateNoteSection> UpdateSections { get; set; } = [];
|
|
|
|
|
|
|
|
|
|
public WelcomePageV2ViewModel(IUpdateManager updateManager)
|
|
|
|
|
{
|
|
|
|
|
_updateManager = updateManager;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override async void OnNavigatedTo(NavigationMode mode, object parameters)
|
|
|
|
|
{
|
|
|
|
|
base.OnNavigatedTo(mode, parameters);
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var updateNotes = await _updateManager.GetLatestUpdateNotesAsync();
|
|
|
|
|
UpdateSections = updateNotes.Sections;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception)
|
|
|
|
|
{
|
|
|
|
|
UpdateSections = [];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[RelayCommand]
|
|
|
|
|
private void GetStarted()
|
|
|
|
|
{
|
2026-03-06 03:42:08 +01:00
|
|
|
Messenger.Send(new BreadcrumbNavigationRequested(
|
|
|
|
|
Translator.WelcomeWizard_Step2Title,
|
|
|
|
|
WinoPage.ProviderSelectionPage));
|
2026-03-05 10:12:03 +01:00
|
|
|
}
|
|
|
|
|
}
|