19 errors, woot

This commit is contained in:
Timothy Baldridge 2021-12-28 13:00:17 -07:00
parent f49083f0c2
commit c4f4f8889a
4 changed files with 20 additions and 10 deletions

View File

@ -1,6 +1,11 @@
using System.Windows.Input;
namespace Wabbajack;
public interface INeedsLogin
{
string SiteName { get; }
ICommand TriggerLogin { get; set; }
ICommand ClearLogin { get; set; }
object? IconUri { get; set; }
}

View File

@ -54,13 +54,12 @@ namespace Wabbajack
[Reactive]
public bool UpdateAvailable { get; private set; }
public MainWindowVM(ILogger<MainWindowVM> logger, MainWindow mainWindow, MainSettings settings, Client wjClient,
public MainWindowVM(ILogger<MainWindowVM> logger, MainSettings settings, Client wjClient,
ServiceProvider serviceProvider)
{
_logger = logger;
_wjClient = wjClient;
ConverterRegistration.Register();
MainWindow = mainWindow;
Settings = settings;
Installer = new Lazy<InstallerVM>(() => new InstallerVM(serviceProvider.GetService<ILogger<InstallerVM>>(), this, serviceProvider));
Compiler = new Lazy<CompilerVM>(() => new CompilerVM(serviceProvider.GetService<ILogger<CompilerVM>>(), this));
@ -189,6 +188,7 @@ namespace Wabbajack
public async Task ShutdownApplication()
{
/*
Dispose();
Settings.PosX = MainWindow.Left;
Settings.PosY = MainWindow.Top;
@ -196,6 +196,7 @@ namespace Wabbajack
Settings.Height = MainWindow.Height;
await MainSettings.SaveSettings(Settings);
Application.Current.Shutdown();
*/
}
}
}

View File

@ -60,12 +60,13 @@ namespace Wabbajack
LoginWithCredentials = loginWithCredentials;
}
/*
_metaInfo = (login.MetaInfo ?? Observable.Return(""))
.ToGuiProperty(this, nameof(MetaInfo));
.ToGuiProperty(this, nameof(MetaInfo));*/
if (!UsesCredentials)
return;
/*
TriggerCredentialsLogin = ReactiveCommand.Create(() =>
{
if (!(login is INeedsLoginCredentials))
@ -74,10 +75,12 @@ namespace Wabbajack
var loginWindow = new LoginWindowView(LoginWithCredentials);
loginWindow.Show();
}, LoginWithCredentials.IsLoggedIn.Select(b => !b).ObserveOnGuiThread());
*/
}
private void LoadImage()
{
/*
Task.Run(async () =>
{
if (Login.IconUri == null) return;
@ -139,6 +142,7 @@ namespace Wabbajack
Favicon = source;
}
});
*/
}
}

View File

@ -22,8 +22,11 @@ namespace Wabbajack
private readonly ILogger<MainWindow> _logger;
private readonly SystemParametersConstructor _systemParams;
public MainWindow(ILogger<MainWindow> logger, SystemParametersConstructor systemParams, LauncherUpdater updater)
public MainWindow(ILogger<MainWindow> logger, SystemParametersConstructor systemParams, LauncherUpdater updater, MainWindowVM vm)
{
_mwvm = vm;
DataContext = _mwvm;
_logger = logger;
_systemParams = systemParams;
try
@ -69,10 +72,7 @@ namespace Wabbajack
_settings = settings;
RunWhenLoaded(LoadSettings);
}*/
// Set datacontext
_mwvm = new MainWindowVM(this, _settings);
DataContext = _mwvm;
// Bring window to the front if it isn't already
this.Initialized += (s, e) =>