<commit_before>using System.Collections.ObjectModel;
using System.Reactive.Linq;
using DynamicData;
using DynamicData.Binding;
using ReactiveUI;
using WalletWasabi.Fluent.ViewModels.NavBar;
using WalletWasabi.Fluent.ViewModels.Search;

namespace WalletWasabi.Fluent.ViewModels
{
	public class SearchPageViewModel : NavBarItemViewModel
	{
		private readonly ReadOnlyObservableCollection<SearchItemViewModel> _searchItems;

		public SearchPageViewModel(NavigationStateViewModel navigationState, WalletManagerViewModel walletManager, AddWalletPageViewModel addWalletPage) : base(navigationState, NavigationTarget.Home)
		{
			Title = "Search";

			var searchItems = new SourceList<SearchItemViewModel>();

			searchItems.Add(new SearchItemViewModel(
				navigationState,
				NavigationTarget.Home,
				iconName: "home_regular",
				title: "Home",
				category: "General",
				keywords: "Home",
				() => new HomePageViewModel(navigationState, walletManager, addWalletPage)));

			searchItems.Add(new SearchItemViewModel(
				navigationState,
				NavigationTarget.Home,
				iconName: "settings_regular",
				title: "Settings",
				category: "General",
				keywords: "Settings, General, User Interface, Privacy, Advanced",
				() => new SettingsPageViewModel(navigationState)));

			searchItems.Add(new SearchItemViewModel(
				navigationState,
				NavigationTarget.Dialog,
				iconName: "add_circle_regular",
				title: "Add Wallet",
				category: "Wallet",
				keywords: "Wallet, Add Wallet, Create Wallet, Recover Wallet, Import Wallet, Connect Hardware Wallet",
				() => addWalletPage));

			walletManager.Items.ToObservableChangeSet()
				.Cast(x => new SearchItemViewModel(
					navigationState,
					NavigationTarget.Home,
					iconName: "web_asset_regular",
					title: x.WalletName,
					category: "Wallet",
					keywords: $"Wallet, {x.WalletName}",
					() => x))
				.Sort(SortExpressionComparer<SearchItemViewModel>.Ascending(i => i.Title))
				.Merge(searchItems.Connect())
				.ObserveOn(RxApp.MainThreadScheduler)
				.Bind(out _searchItems)
				.AsObservableList();
		}

		public override string IconName => "search_regular";

		public ReadOnlyObservableCollection<SearchItemViewModel> SearchItems => _searchItems;
	}
}<commit_msg>Added SearchQuery property<commit_after>using System.Collections.ObjectModel;
using System.Reactive.Linq;
using DynamicData;
using DynamicData.Binding;
using ReactiveUI;
using WalletWasabi.Fluent.ViewModels.NavBar;
using WalletWasabi.Fluent.ViewModels.Search;

namespace WalletWasabi.Fluent.ViewModels
{
	public class SearchPageViewModel : NavBarItemViewModel
	{
		private string? _searchQuery;
		private readonly ReadOnlyObservableCollection<SearchItemViewModel> _searchItems;

		public SearchPageViewModel(NavigationStateViewModel navigationState, WalletManagerViewModel walletManager, AddWalletPageViewModel addWalletPage) : base(navigationState, NavigationTarget.Home)
		{
			Title = "Search";

			var searchItems = new SourceList<SearchItemViewModel>();

			searchItems.Add(new SearchItemViewModel(
				navigationState,
				NavigationTarget.Home,
				iconName: "home_regular",
				title: "Home",
				category: "General",
				keywords: "Home",
				() => new HomePageViewModel(navigationState, walletManager, addWalletPage)));

			searchItems.Add(new SearchItemViewModel(
				navigationState,
				NavigationTarget.Home,
				iconName: "settings_regular",
				title: "Settings",
				category: "General",
				keywords: "Settings, General, User Interface, Privacy, Advanced",
				() => new SettingsPageViewModel(navigationState)));

			searchItems.Add(new SearchItemViewModel(
				navigationState,
				NavigationTarget.Dialog,
				iconName: "add_circle_regular",
				title: "Add Wallet",
				category: "Wallet",
				keywords: "Wallet, Add Wallet, Create Wallet, Recover Wallet, Import Wallet, Connect Hardware Wallet",
				() => addWalletPage));

			walletManager.Items.ToObservableChangeSet()
				.Cast(x => new SearchItemViewModel(
					navigationState,
					NavigationTarget.Home,
					iconName: "web_asset_regular",
					title: x.WalletName,
					category: "Wallet",
					keywords: $"Wallet, {x.WalletName}",
					() => x))
				.Sort(SortExpressionComparer<SearchItemViewModel>.Ascending(i => i.Title))
				.Merge(searchItems.Connect())
				.ObserveOn(RxApp.MainThreadScheduler)
				.Bind(out _searchItems)
				.AsObservableList();
		}

		public override string IconName => "search_regular";

		public string? SearchQuery
		{
			get => _searchQuery;
			set => this.RaiseAndSetIfChanged(ref _searchQuery, value);
		}

		public ReadOnlyObservableCollection<SearchItemViewModel> SearchItems => _searchItems;
	}
}
{'fraction_non_alphanumeric': 0.10204081632653061, 'fraction_numerical': 0.0, 'mean_word_length': 4.976893453145058, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 29, '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': '525861', 'n_tokens_mistral': 1617, 'n_tokens_neox': 1308, 'n_words': 276}