Files
better-genshin-impact/BetterGenshinImpact/ViewModel/Pages/MacroSettingsPageViewModel.cs
辉鸭蛋 46ebdfc452 wpfui 4.0.0 (#1255)
* new INavigationAware, remove PageService

* fix run

* fix title bar

* override OnNavigatedTo

* try fix WindowStartupLocation
2025-03-13 00:33:31 +08:00

47 lines
1.3 KiB
C#

using BetterGenshinImpact.Core.Config;
using BetterGenshinImpact.GameTask.AutoFight;
using BetterGenshinImpact.Service.Interface;
using BetterGenshinImpact.View.Pages;
using BetterGenshinImpact.View.Windows;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System.Diagnostics;
using Wpf.Ui;
using Wpf.Ui.Controls;
namespace BetterGenshinImpact.ViewModel.Pages;
public partial class MacroSettingsPageViewModel : ViewModel
{
public AllConfig Config { get; set; }
private readonly INavigationService _navigationService;
[ObservableProperty]
private string[] _quickFightMacroHotkeyMode = [OneKeyFightTask.HoldOnMode, OneKeyFightTask.TickMode];
public MacroSettingsPageViewModel(IConfigService configService, INavigationService navigationService)
{
Config = configService.Get();
_navigationService = navigationService;
}
[RelayCommand]
public void OnGoToHotKeyPage()
{
_navigationService.Navigate(typeof(HotKeyPage));
}
[RelayCommand]
public void OnEditAvatarMacro()
{
JsonMonoDialog.Show(@"User\avatar_macro.json");
}
[RelayCommand]
public void OnGoToOneKeyMacroUrl()
{
Process.Start(new ProcessStartInfo("https://bettergi.com/feats/macro/onem.html") { UseShellExecute = true });
}
}