ViewModel-First (#9621)

* Interaction

* Remove view action

* ViewModel-first

* MainGirdOrientation Hot Reload

* Fix avalonia preview

* Remove CloseWindowInteraction

* Fix

* Avoid threading issues

* Fix

* ProfilesSelect

* Try fix previewer

* Remove AppEvents.ProfilesRefreshRequested

* Remove AppEvents.SubscriptionsRefreshRequested

* Remove AppEvents.ProxiesReloadRequested

* Remove AppEvents.AdjustMainLvColWidthRequested

* Remove AppEvents.SetDefaultServerRequested

* Remove AppEvents.RoutingsMenuRefreshRequested

* Remove AppEvents.TestServerRequested

* Remove AppEvents.InboundDisplayRequested

* Remove AppEvents.SubscriptionsUpdateRequested

* Remove AppEvents.ShowHideWindowRequested

* Remove AppEvents.ReloadRequested

* Remove AppEvents.AddServerRequested

* Fix
This commit is contained in:
DHR60
2026-07-14 01:05:05 +00:00
committed by GitHub
parent 6f50206606
commit 9664ee380e
115 changed files with 2075 additions and 2190 deletions
@@ -1,15 +1,16 @@
namespace ServiceLib.ViewModels;
public class GlobalHotkeySettingViewModel : MyReactiveObject
public class GlobalHotkeySettingViewModel : MyReactiveObject, ICloseable
{
public event EventHandler? RequestClose;
private readonly List<KeyEventItem> _globalHotkeys;
public ReactiveCommand<Unit, Unit> SaveCmd { get; }
public GlobalHotkeySettingViewModel(Func<EViewAction, object?, Task<bool>>? updateView)
public GlobalHotkeySettingViewModel()
{
_config = AppManager.Instance.Config;
_updateView = updateView;
_globalHotkeys = JsonUtils.DeepCopy(_config.GlobalHotkeys);
@@ -51,7 +52,7 @@ public class GlobalHotkeySettingViewModel : MyReactiveObject
if (await ConfigHandler.SaveConfig(_config) == 0)
{
_updateView?.Invoke(EViewAction.CloseWindow, null);
RequestClose?.Invoke(this, EventArgs.Empty);
}
else
{