mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix MainWindow to use shared ViewModel from DI and add console logging
This commit is contained in:
parent
e961dc5668
commit
207953159a
2 changed files with 6 additions and 4 deletions
|
|
@ -19,9 +19,8 @@ public partial class MainWindow : Window
|
|||
{
|
||||
InitializeComponent();
|
||||
|
||||
// Create and set the ViewModel
|
||||
var settings = Ioc.Default.GetRequiredService<Settings>();
|
||||
_viewModel = new MainViewModel(settings);
|
||||
// Get the ViewModel from DI (same instance that App uses)
|
||||
_viewModel = Ioc.Default.GetRequiredService<MainViewModel>();
|
||||
_viewModel.HideRequested += () => Hide();
|
||||
DataContext = _viewModel;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System.Diagnostics;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.ExceptionServices;
|
||||
|
|
@ -149,6 +149,9 @@ namespace Flow.Launcher.Infrastructure.Logger
|
|||
var logger = LogManager.GetLogger(classNameWithMethod);
|
||||
|
||||
logger.Log(level, message);
|
||||
|
||||
// Also output to console for easy debugging
|
||||
System.Console.WriteLine($"[{level}] {classNameWithMethod}: {message}");
|
||||
}
|
||||
|
||||
public static void Debug(string className, string message, [CallerMemberName] string methodName = "")
|
||||
|
|
|
|||
Loading…
Reference in a new issue