<commit_before>using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Notifications;
using Avalonia.Markup.Xaml;
using Avalonia.Media;
using Avalonia.Native;
using Avalonia.Threading;
using AvalonStudio.Extensibility;
using AvalonStudio.Extensibility.Theme;
using AvalonStudio.Shell;
using AvalonStudio.Shell.Controls;
using NBitcoin;
using ReactiveUI;
using Splat;
using System;
using System.ComponentModel;
using System.Composition;
using System.IO;
using System.Linq;
using System.Reactive.Linq;
using System.Reactive.Threading.Tasks;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using WalletWasabi.Gui.Dialogs;
using WalletWasabi.Gui.Helpers;
using WalletWasabi.Gui.Tabs.WalletManager;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Logging;

namespace WalletWasabi.Gui
{
	public class MainWindow : MetroWindow
	{
		public bool IsQuitPending { get; private set; }

		public MainWindow()
		{
			InitializeComponent();
#if DEBUG
			this.AttachDevTools();
#endif

			var notificationManager = new WindowNotificationManager(this)
			{
				Position = NotificationPosition.BottomRight,
				MaxItems = 4,
				Margin = new Thickness(0, 0, 15, 40)
			};

			Locator.CurrentMutable.RegisterConstant<INotificationManager>(notificationManager);

			Dispatcher.UIThread.InvokeAsync(async () =>
			{
				await Task.Delay(3000);

				NotificationHelpers.Information("Welcome!", "Welcome to Wasabi");
			});
		}

		public Global Global => MainWindowViewModel.Instance.Global;

		private void InitializeComponent()
		{
			Closing += MainWindow_ClosingAsync;
			AvaloniaXamlLoader.Load(this);
			DisplayWalletManager();

			var uiConfigFilePath = Path.Combine(Global.DataDir, "UiConfig.json");
			var uiConfig = new UiConfig(uiConfigFilePath);
			uiConfig.LoadOrCreateDefaultFileAsync()
				.ToObservable(RxApp.TaskpoolScheduler)
				.Take(1)
				.ObserveOn(RxApp.MainThreadScheduler)<commit_msg>remove test code.<commit_after>using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Notifications;
using Avalonia.Markup.Xaml;
using Avalonia.Media;
using Avalonia.Native;
using Avalonia.Threading;
using AvalonStudio.Extensibility;
using AvalonStudio.Extensibility.Theme;
using AvalonStudio.Shell;
using AvalonStudio.Shell.Controls;
using NBitcoin;
using ReactiveUI;
using Splat;
using System;
using System.ComponentModel;
using System.Composition;
using System.IO;
using System.Linq;
using System.Reactive.Linq;
using System.Reactive.Threading.Tasks;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using WalletWasabi.Gui.Dialogs;
using WalletWasabi.Gui.Helpers;
using WalletWasabi.Gui.Tabs.WalletManager;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Logging;

namespace WalletWasabi.Gui
{
	public class MainWindow : MetroWindow
	{
		public bool IsQuitPending { get; private set; }

		public MainWindow()
		{
			InitializeComponent();
#if DEBUG
			this.AttachDevTools();
#endif

			var notificationManager = new WindowNotificationManager(this)
			{
				Position = NotificationPosition.BottomRight,
				MaxItems = 4,
				Margin = new Thickness(0, 0, 15, 40)
			};

			Locator.CurrentMutable.RegisterConstant<INotificationManager>(notificationManager);
		}

		public Global Global => MainWindowViewModel.Instance.Global;

		private void InitializeComponent()
		{
			Closing += MainWindow_ClosingAsync;
			AvaloniaXamlLoader.Load(this);
			DisplayWalletManager();

			var uiConfigFilePath = Path.Combine(Global.DataDir, "UiConfig.json");
			var uiConfig = new UiConfig(uiConfigFilePath);
			uiConfig.LoadOrCreateDefaultFileAsync()
				.ToObservable(RxApp.TaskpoolScheduler)
				.Take(1)
				.ObserveOn(RxApp.MainThreadScheduler)
{'fraction_non_alphanumeric': 0.09312282579609313, 'fraction_numerical': 0.005351886540005352, 'mean_word_length': 5.467128027681661, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2252014', 'n_tokens_mistral': 1301, 'n_tokens_neox': 1165, 'n_words': 238}