Files

45 lines
1.7 KiB
C#
Raw Permalink Normal View History

using System;
using CommunityToolkit.Mvvm.Input;
2024-04-18 01:44:37 +02:00
using CommunityToolkit.Mvvm.Messaging;
using Wino.Core.Domain;
2024-04-18 01:44:37 +02:00
using Wino.Core.Domain.Enums;
using Wino.Messaging.Client.Navigation;
2024-04-18 01:44:37 +02:00
2025-02-16 11:54:23 +01:00
namespace Wino.Core.ViewModels;
public partial class SettingOptionsPageViewModel : CoreBaseViewModel
2024-04-18 01:44:37 +02:00
{
2025-02-16 11:54:23 +01:00
[RelayCommand]
private void GoAccountSettings() => Messenger.Send<NavigateManageAccountsRequested>();
2024-04-18 01:44:37 +02:00
2025-02-16 11:54:23 +01:00
[RelayCommand]
public void NavigateSubDetail(object type)
{
if (type is WinoPage pageType)
2024-04-18 01:44:37 +02:00
{
2025-02-16 11:54:23 +01:00
if (pageType == WinoPage.AccountManagementPage)
2024-04-18 01:44:37 +02:00
{
2025-02-16 11:54:23 +01:00
GoAccountSettings();
return;
2024-04-18 01:44:37 +02:00
}
2025-02-16 11:54:23 +01:00
string pageTitle = pageType switch
{
WinoPage.PersonalizationPage => Translator.SettingsPersonalization_Title,
WinoPage.AboutPage => Translator.SettingsAbout_Title,
WinoPage.MessageListPage => Translator.SettingsMessageList_Title,
WinoPage.ReadComposePanePage => Translator.SettingsReadComposePane_Title,
WinoPage.LanguageTimePage => Translator.SettingsLanguageTime_Title,
WinoPage.AppPreferencesPage => Translator.SettingsAppPreferences_Title,
WinoPage.CalendarSettingsPage => Translator.SettingsCalendarSettings_Title,
2025-11-23 20:56:57 +01:00
WinoPage.SignatureAndEncryptionPage => Translator.SettingsSignatureAndEncryption_Title,
2025-12-31 13:28:53 +01:00
WinoPage.KeyboardShortcutsPage => Translator.Settings_KeyboardShortcuts_Title,
WinoPage.StoragePage => Translator.SettingsStorage_Title,
2025-02-16 11:54:23 +01:00
_ => throw new NotImplementedException()
};
Messenger.Send(new BreadcrumbNavigationRequested(pageTitle, pageType));
2024-04-18 01:44:37 +02:00
}
2025-02-16 11:54:23 +01:00
}
2024-04-18 01:44:37 +02:00
}