Files
MesenCE/UI/ViewModels/InputConfigViewModel.cs
SourMesen 40335ce735 UI: Update to Avalonia 12, .NET 10 and replace ReactiveUI with MVVM community toolkit (#142)
Also fixes DX11.0 support (for Win7 PCs that aren't fully updated), which stopped working after the recent variable refresh rate changes
2026-07-03 16:04:42 +09:00

26 lines
638 B
C#

using Avalonia.Controls;
using Mesen.Config;
using Mesen.Utilities;
using CommunityToolkit.Mvvm.ComponentModel;
namespace Mesen.ViewModels
{
public partial class InputConfigViewModel : DisposableViewModel
{
[ObservableProperty] public partial InputConfig Config { get; set; }
[ObservableProperty] public partial InputConfig OriginalConfig { get; set; }
public InputConfigViewModel()
{
Config = ConfigManager.Config.Input;
OriginalConfig = Config.Clone();
if(Design.IsDesignMode) {
return;
}
AddDisposable(ReactiveHelper.RegisterRecursiveObserver(Config, (s, e) => { Config.ApplyConfig(); }));
}
}
}