mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
use constructor injection for PublicAPIInstance.cs
This commit is contained in:
parent
91490c0251
commit
16798a06ce
1 changed files with 4 additions and 6 deletions
|
|
@ -34,16 +34,14 @@ namespace Flow.Launcher
|
|||
public class PublicAPIInstance : IPublicAPI
|
||||
{
|
||||
private readonly Settings _settings;
|
||||
private readonly SettingWindowViewModel _settingsVM;
|
||||
private readonly MainViewModel _mainVM;
|
||||
|
||||
#region Constructor
|
||||
|
||||
public PublicAPIInstance()
|
||||
public PublicAPIInstance(Settings settings, MainViewModel mainVM)
|
||||
{
|
||||
_settings = Ioc.Default.GetRequiredService<Settings>();
|
||||
_settingsVM = Ioc.Default.GetRequiredService<SettingWindowViewModel>();
|
||||
_mainVM = Ioc.Default.GetRequiredService<MainViewModel>();
|
||||
_settings = settings;
|
||||
_mainVM = mainVM;
|
||||
GlobalHotkey.hookedKeyboardCallback = KListener_hookedKeyboardCallback;
|
||||
WebRequest.RegisterPrefix("data", new DataWebRequestFactory());
|
||||
}
|
||||
|
|
@ -87,7 +85,7 @@ namespace Flow.Launcher
|
|||
{
|
||||
PluginManager.Save();
|
||||
_mainVM.Save();
|
||||
_settingsVM.Save();
|
||||
_settings.Save();
|
||||
_ = ImageLoader.Save();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue