<commit_before>using ReactiveUI;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Helpers;
using WalletWasabi.Wallets;

namespace WalletWasabi.Gui.Controls.WalletExplorer
{
	public class WalletViewModelBase : ViewModelBase, IComparable<WalletViewModelBase>, IDisposable
	{
		private bool _isExpanded;
		private bool _isBusy;
		private string _title;
		private WalletState _walletState;
		private CompositeDisposable _disposables;
		private bool _disposedValue;

		public WalletViewModelBase(Wallet wallet)
		{
			Wallet = Guard.NotNull(nameof(wallet), wallet);

			_disposables = new CompositeDisposable();

			Wallet = wallet;
			Title = WalletName;

			WalletState = wallet.State;

			Observable.FromEventPattern<WalletState>(wallet, nameof(wallet.StateChanged))
				.ObserveOn(RxApp.MainThreadScheduler)
				.Subscribe(x =>
				{
					WalletState = x.EventArgs;
				})
				.DisposeWith(_disposables);

			this.WhenAnyValue(x => x.WalletState)
				.Subscribe(x =>
				{
					switch (x)
					{
						case WalletState.Initialized:
						case WalletState.Started:
						case WalletState.Stopped:
						case WalletState.Uninitialized:
							IsBusy = false;
							break;

						default:
							IsBusy = true;
							break;<commit_msg>immediately show busy when wallet is just initialized.<commit_after>using ReactiveUI;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Helpers;
using WalletWasabi.Wallets;

namespace WalletWasabi.Gui.Controls.WalletExplorer
{
	public class WalletViewModelBase : ViewModelBase, IComparable<WalletViewModelBase>, IDisposable
	{
		private bool _isExpanded;
		private bool _isBusy;
		private string _title;
		private WalletState _walletState;
		private CompositeDisposable _disposables;
		private bool _disposedValue;

		public WalletViewModelBase(Wallet wallet)
		{
			Wallet = Guard.NotNull(nameof(wallet), wallet);

			_disposables = new CompositeDisposable();

			Wallet = wallet;
			Title = WalletName;

			WalletState = wallet.State;

			Observable.FromEventPattern<WalletState>(wallet, nameof(wallet.StateChanged))
				.ObserveOn(RxApp.MainThreadScheduler)
				.Subscribe(x =>
				{
					WalletState = x.EventArgs;
				})
				.DisposeWith(_disposables);

			this.WhenAnyValue(x => x.WalletState)
				.Subscribe(x =>
				{
					switch (x)
					{
						case WalletState.Started:
						case WalletState.Stopped:
						case WalletState.Uninitialized:
							IsBusy = false;
							break;

						default:
							IsBusy = true;
							break;
{'fraction_non_alphanumeric': 0.08440840398083303, 'fraction_numerical': 0.0, 'mean_word_length': 3.8637992831541217, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '4043349', 'n_tokens_mistral': 1062, 'n_tokens_neox': 861, 'n_words': 172}