diff --git a/Wabbajack.App.Wpf/View Models/Interfaces/INeedsLogin.cs b/Wabbajack.App.Wpf/View Models/Interfaces/INeedsLogin.cs index 6c4003b5..82dd5d73 100644 --- a/Wabbajack.App.Wpf/View Models/Interfaces/INeedsLogin.cs +++ b/Wabbajack.App.Wpf/View Models/Interfaces/INeedsLogin.cs @@ -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; } } \ No newline at end of file diff --git a/Wabbajack.App.Wpf/View Models/MainWindowVM.cs b/Wabbajack.App.Wpf/View Models/MainWindowVM.cs index 81e297f5..4373d87e 100644 --- a/Wabbajack.App.Wpf/View Models/MainWindowVM.cs +++ b/Wabbajack.App.Wpf/View Models/MainWindowVM.cs @@ -54,13 +54,12 @@ namespace Wabbajack [Reactive] public bool UpdateAvailable { get; private set; } - public MainWindowVM(ILogger logger, MainWindow mainWindow, MainSettings settings, Client wjClient, + public MainWindowVM(ILogger logger, MainSettings settings, Client wjClient, ServiceProvider serviceProvider) { _logger = logger; _wjClient = wjClient; ConverterRegistration.Register(); - MainWindow = mainWindow; Settings = settings; Installer = new Lazy(() => new InstallerVM(serviceProvider.GetService>(), this, serviceProvider)); Compiler = new Lazy(() => new CompilerVM(serviceProvider.GetService>(), 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(); + */ } } } diff --git a/Wabbajack.App.Wpf/View Models/Settings/LoginManagerVM.cs b/Wabbajack.App.Wpf/View Models/Settings/LoginManagerVM.cs index bdc908f1..70f2cb40 100644 --- a/Wabbajack.App.Wpf/View Models/Settings/LoginManagerVM.cs +++ b/Wabbajack.App.Wpf/View Models/Settings/LoginManagerVM.cs @@ -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; } }); + */ } } diff --git a/Wabbajack.App.Wpf/Views/MainWindow.xaml.cs b/Wabbajack.App.Wpf/Views/MainWindow.xaml.cs index 7e980776..45eef055 100644 --- a/Wabbajack.App.Wpf/Views/MainWindow.xaml.cs +++ b/Wabbajack.App.Wpf/Views/MainWindow.xaml.cs @@ -22,8 +22,11 @@ namespace Wabbajack private readonly ILogger _logger; private readonly SystemParametersConstructor _systemParams; - public MainWindow(ILogger logger, SystemParametersConstructor systemParams, LauncherUpdater updater) + public MainWindow(ILogger 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) =>