ronantakizawa/codereview-bench huggingface dataset:
Repository: files-community/Files
File: src/Files.App/ViewModels/ShellViewModel.cs (C#)

Code before:
			cancellationToken.ThrowIfCancellationRequested();

			if (iconOverlay is not null)
			{
				await dispatcherQueue.EnqueueOrInvokeAsync(async () =>
				{
					item.IconOverlay = await iconOverlay.ToBitmapAsync();
					item.ShieldIcon = await GetShieldIcon();
				}, Microsoft.UI.Dispatching.DispatcherQueuePriority.Normal);

				cancellationToken.ThrowIfCancellationRequested();
			}

			if (loadNonCachedThumbnail)
			{
				// Get non-cached thumbnail asynchronously
				_ = Task.Run(async () =>
				{
					await loadThumbnailSemaphore.WaitAsync(cancellationToken);
					try
					{
						result = await FileThumbnailHelper.GetIconAsync(
								item.ItemPath,
								thumbnailSize,
								item.IsFolder,
								IconOptions.ReturnThumbnailOnly | (useCurrentScale ? IconOptions.UseCurrentScale : 0));
					}
					finally
					{
						loadThumbnailSemaphore.Release();
					}

					cancellationToken.ThrowIfCancellationRequested();

					if (result is not null)
					{
						await dispatcherQueue.EnqueueOrInvokeAsync(async () =>
						{
							// Assign FileImage property
							var image = await result.ToBitmapAsync();
							if (image is not null)
								item.FileImage = image;
						}, Microsoft.UI.Dispatching.DispatcherQueuePriority.Normal);
					}
				}, cancellationToken);
			}
		}

		private static void SetFileTag(ListedItem item)
		{
			var dbInstance = FileTagsHelper.GetDbInstance();

Review comment (suggestion):
```suggestion
								IconOptions.ReturnThumbnailOnly | (useCurrentScale ? IconOptions.UseCurrentScale : IconOptions.None));
```

Code after:
			cancellationToken.ThrowIfCancellationRequested();

			if (iconOverlay is not null)
			{
				await dispatcherQueue.EnqueueOrInvokeAsync(async () =>
				{
					item.IconOverlay = await iconOverlay.ToBitmapAsync();
					item.ShieldIcon = await GetShieldIcon();
				}, Microsoft.UI.Dispatching.DispatcherQueuePriority.Normal);

				cancellationToken.ThrowIfCancellationRequested();
			}

			if (loadNonCachedThumbnail)
			{
				// Get non-cached thumbnail asynchronously
				_ = Task.Run(async () =>
				{
					await loadThumbnailSemaphore.WaitAsync(cancellationToken);
					try
					{
						result = await FileThumbnailHelper.GetIconAsync(
								item.ItemPath,
								thumbnailSize,
								item.IsFolder,
								IconOptions.ReturnThumbnailOnly | (useCurrentScale ? IconOptions.UseCurrentScale : IconOptions.None));
					}
					finally
					{
						loadThumbnailSemaphore.Release();
					}

					cancellationToken.ThrowIfCancellationRequested();

					if (result is not null)
					{
						await dispatcherQueue.EnqueueOrInvokeAsync(async () =>
						{
							// Assign FileImage property
							var image = await result.ToBitmapAsync();
							if (image is not null)
								item.FileImage = image;
						}, Microsoft.UI.Dispatching.DispatcherQueuePriority.Normal);
					}
				}, cancellationToken);
			}
		}

		private static void SetFileTag(ListedItem item)
		{
			var dbInstance = FileTagsHelper.GetDbInstance();
Repository: files-community/Files
File: src/Files.App/UserControls/Widgets/RecentFilesWidget.xaml.cs (C#)

Code before:
// Copyright (c) Files Community
// Licensed under the MIT License.

using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;
using Windows.ApplicationModel.DataTransfer;
using Windows.Storage;

namespace Files.App.UserControls.Widgets
{
	/// <summary>
	/// Represents a control that displays a list of recent folders with <see cref="WidgetFolderCardItem"/>.
	/// </summary>
	public sealed partial class RecentFilesWidget : UserControl
	{
		public RecentFilesWidgetViewModel ViewModel { get; set; } = Ioc.Default.GetRequiredService<RecentFilesWidgetViewModel>();

		public RecentFilesWidget()
		{
			InitializeComponent();
		}

		private void RecentFilesListView_ItemClick(object sender, ItemClickEventArgs e)
		{
			if (e.ClickedItem is not RecentItem item)
				return;

			ViewModel.NavigateToPath(item.Path);
		}

		private void RecentFilesListView_RightTapped(object sender, RightTappedRoutedEventArgs e)
		{
			ViewModel.BuildItemContextMenu(e.OriginalSource, e);
		}

		private async void RecentFilesListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
		{

Review comment (suggestion):
```suggestion
	/// Represents a control that displays a list of recent files with <see cref="WidgetFolderCardItem"/>.
```

Code after:
// Copyright (c) Files Community
// Licensed under the MIT License.

using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;
using Windows.ApplicationModel.DataTransfer;
using Windows.Storage;

namespace Files.App.UserControls.Widgets
{
	/// <summary>
	/// Represents a control that displays a list of recent files with <see cref="WidgetFolderCardItem"/>.
	/// </summary>
	public sealed partial class RecentFilesWidget : UserControl
	{
		public RecentFilesWidgetViewModel ViewModel { get; set; } = Ioc.Default.GetRequiredService<RecentFilesWidgetViewModel>();

		public RecentFilesWidget()
		{
			InitializeComponent();
		}

		private void RecentFilesListView_ItemClick(object sender, ItemClickEventArgs e)
		{
			if (e.ClickedItem is not RecentItem item)
				return;

			ViewModel.NavigateToPath(item.Path);
		}

		private void RecentFilesListView_RightTapped(object sender, RightTappedRoutedEventArgs e)
		{
			ViewModel.BuildItemContextMenu(e.OriginalSource, e);
		}

		private async void RecentFilesListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
		{
Repository: files-community/Files
File: src/Files.App/Views/Properties/HashesPage.xaml.cs (C#)

Code before:
		}

		protected override void OnNavigatedTo(NavigationEventArgs e)
		{
			var np = (PropertiesPageNavigationParameter)e.Parameter;
			if (np.Parameter is ListedItem listedItem)
				HashesViewModel = new(listedItem);

			base.OnNavigatedTo(e);
		}

		private void CopyHashButton_Click(object sender, RoutedEventArgs e)
		{
			var item = (HashInfoItem)(((Button)sender).DataContext);

			var dp = new Windows.ApplicationModel.DataTransfer.DataPackage();
			dp.SetText(item.HashValue);
			Windows.ApplicationModel.DataTransfer.Clipboard.SetContent(dp);
		}

		private void ToggleMenuFlyoutItem_Click(object sender, RoutedEventArgs e)
		{
			_cancel = true;
		}

		private void HashInputTextBox_TextChanged(object sender, TextChangedEventArgs e)
		{
			string? matchingAlgorithm = null;

			try
			{
				matchingAlgorithm = HashesViewModel.FindMatchingAlgorithm(HashInputTextBox.Text);
			}
			catch (ArgumentNullException)
			{
				return;
			}

			if (string.IsNullOrEmpty(matchingAlgorithm))
			{
				HashesViewModel.InfoBarVisible = true;
				HashMatchInfoBar.Severity = InfoBarSeverity.Error;
				HashMatchInfoBar.Title = Strings.HashesDoNotMatch.GetLocalizedResource();
				return;
			}
			else
			{
				HashesViewModel.InfoBarVisible = true;
				HashMatchInfoBar.Severity = InfoBarSeverity.Success;
				HashMatchInfoBar.Title = string.Format(Strings.HashesMatch.GetLocalizedResource(), matchingAlgorithm);
				return;

Review comment (suggestion):
We can remove the event handler and directly bind the text to the view model. As the property updates, we can compare the hashes and update the info bar's visibility and message accordingly.



Code after:

			if (parameter.Parameter is ListedItem listedItem)
				HashesViewModel = new(listedItem, parameter.Window.AppWindow);

			base.OnNavigatedTo(e);
		}

		private void CopyHashButton_Click(object sender, RoutedEventArgs e)
		{
			var item = (HashInfoItem)(((Button)sender).DataContext);

			var dp = new Windows.ApplicationModel.DataTransfer.DataPackage();
			dp.SetText(item.HashValue);
			Windows.ApplicationModel.DataTransfer.Clipboard.SetContent(dp);
		}

		private void ToggleMenuFlyoutItem_Click(object sender, RoutedEventArgs e)
		{
			_cancel = true;
		}

		private void MenuFlyout_Closing(FlyoutBase sender, FlyoutBaseClosingEventArgs e)
		{
			e.Cancel = _cancel;
			_cancel = false;
		}

		protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
			=> Dispose();

		public async override Task<bool> SaveChangesAsync()
		{
			return true;
		}

		public override void Dispose()
		{
			HashesViewModel.Dispose();
		}
	}
}
Repository: files-community/Files
File: src/Files.App/ViewModels/Properties/HashesViewModel.cs (C#)

Code before:
		public ObservableCollection<HashInfoItem> Hashes { get; set; }

		public Dictionary<string, bool> ShowHashes { get; private set; }

		public ICommand ToggleIsEnabledCommand { get; private set; }
		public ICommand HashInputTextChangedCommand { get; private set; }
		public ICommand CompareFileCommand { get; private set; }

		private ListedItem _item;

		private CancellationTokenSource _cancellationTokenSource;

		private string _hashInput;
		public string HashInput
		{
			get => _hashInput;
			set
			{
				OnHashInputTextChanged();
				SetProperty(ref _hashInput, value);

				OnPropertyChanged(nameof(IsInfoBarOpen));
			}
		}

		private InfoBarSeverity _infoBarSeverity;
		public InfoBarSeverity InfoBarSeverity
		{
			get => _infoBarSeverity;
			set => SetProperty(ref _infoBarSeverity, value);
		}

		private string _infoBarTitle;
		public string InfoBarTitle
		{
			get => _infoBarTitle;
			set => SetProperty(ref _infoBarTitle, value);
		}

		private bool _isInfoBarOpen;
		public bool IsInfoBarOpen
		{
			get => !string.IsNullOrEmpty(HashInput);
			set => SetProperty(ref _isInfoBarOpen, value);
		}

		public HashesViewModel(ListedItem item)
		{
			ToggleIsEnabledCommand = new RelayCommand<string>(ToggleIsEnabled);

			_item = item;

Review comment (suggestion):
```suggestion
		private string _hashInput;
		public string HashInput
		{
			get => _hashInput;
			set
			{
				SetProperty(ref _hashInput, value);

				OnPropertyChanged(nameof(IsInfoBarOpen));
				OnHashInputTextChanged();
			}
		}
```

Code after:
			set => SetProperty(ref _selectedItem, value);
		}

		public ObservableCollection<HashInfoItem> Hashes { get; set; }

		public Dictionary<string, bool> ShowHashes { get; private set; }

		public ICommand ToggleIsEnabledCommand { get; private set; }
		public ICommand CompareFileCommand { get; private set; }

		private ListedItem _item;

		private CancellationTokenSource _cancellationTokenSource;

		private string _hashInput;
		public string HashInput
		{
			get => _hashInput;
			set
			{
				SetProperty(ref _hashInput, value);

				OnHashInputTextChanged();
				OnPropertyChanged(nameof(IsInfoBarOpen));
			}
		}

		private InfoBarSeverity _infoBarSeverity;
		public InfoBarSeverity InfoBarSeverity
		{
			get => _infoBarSeverity;
			set => SetProperty(ref _infoBarSeverity, value);
		}

		private string _infoBarTitle;
		public string InfoBarTitle
		{
			get => _infoBarTitle;
			set => SetProperty(ref _infoBarTitle, value);
		}

		public bool IsInfoBarOpen
			=> !string.IsNullOrEmpty(HashInput);

		public HashesViewModel(ListedItem item, AppWindow appWindow)
		{
			ToggleIsEnabledCommand = new RelayCommand<string>(ToggleIsEnabled);

			_item = item;
			_appWindow = appWindow;
			_cancellationTokenSource = new();
Repository: files-community/Files
File: src/Files.App/ViewModels/Properties/HashesViewModel.cs (C#)

Code before:
				OnHashInputTextChanged();
				OnPropertyChanged(nameof(IsInfoBarOpen));
				IsInfoBarOpen = !string.IsNullOrEmpty(value);
			}
		}

		private InfoBarSeverity _infoBarSeverity;
		public InfoBarSeverity InfoBarSeverity
		{
			get => _infoBarSeverity;
			set => SetProperty(ref _infoBarSeverity, value);
		}

		private string _infoBarTitle;
		public string InfoBarTitle
		{
			get => _infoBarTitle;
			set => SetProperty(ref _infoBarTitle, value);
		}

		private bool _isInfoBarOpen;
		public bool IsInfoBarOpen
		{
			get => _isInfoBarOpen;
			set => SetProperty(ref _isInfoBarOpen, value);
		}

		public HashesViewModel(ListedItem item)
		{
			ToggleIsEnabledCommand = new RelayCommand<string>(ToggleIsEnabled);

			_item = item;
			_cancellationTokenSource = new();

			Hashes =
			[
				new() { Algorithm = "CRC32" },
				new() { Algorithm = "MD5" },
				new() { Algorithm = "SHA1" },
				new() { Algorithm = "SHA256" },
				new() { Algorithm = "SHA384" },
				new() { Algorithm = "SHA512" },
			];

			ShowHashes = UserSettingsService.GeneralSettingsService.ShowHashesDictionary ?? [];
			// Default settings
			ShowHashes.TryAdd("CRC32", true);
			ShowHashes.TryAdd("MD5", true);
			ShowHashes.TryAdd("SHA1", true);
			ShowHashes.TryAdd("SHA256", true);
			ShowHashes.TryAdd("SHA384", false);

Review comment (suggestion):
```suggestion
		public bool IsInfoBarOpen
		 => !string.IsNullOrEmpty(HashInput);
```
This change should eliminate the need for manual property assignment.

Code after:
			{
				SetProperty(ref _hashInput, value);

				OnHashInputTextChanged();
				OnPropertyChanged(nameof(IsInfoBarOpen));
			}
		}

		private InfoBarSeverity _infoBarSeverity;
		public InfoBarSeverity InfoBarSeverity
		{
			get => _infoBarSeverity;
			set => SetProperty(ref _infoBarSeverity, value);
		}

		private string _infoBarTitle;
		public string InfoBarTitle
		{
			get => _infoBarTitle;
			set => SetProperty(ref _infoBarTitle, value);
		}

		public bool IsInfoBarOpen
			=> !string.IsNullOrEmpty(HashInput);

		public HashesViewModel(ListedItem item, AppWindow appWindow)
		{
			ToggleIsEnabledCommand = new RelayCommand<string>(ToggleIsEnabled);

			_item = item;
			_appWindow = appWindow;
			_cancellationTokenSource = new();

			Hashes =
			[
				new() { Algorithm = "CRC32" },
				new() { Algorithm = "MD5" },
				new() { Algorithm = "SHA1" },
				new() { Algorithm = "SHA256" },
				new() { Algorithm = "SHA384" },
				new() { Algorithm = "SHA512" },
			];

			ShowHashes = UserSettingsService.GeneralSettingsService.ShowHashesDictionary ?? [];
			// Default settings
			ShowHashes.TryAdd("CRC32", true);
			ShowHashes.TryAdd("MD5", true);
			ShowHashes.TryAdd("SHA1", true);
			ShowHashes.TryAdd("SHA256", true);
			ShowHashes.TryAdd("SHA384", false);
			ShowHashes.TryAdd("SHA512", false);
Repository: files-community/Files
File: src/Files.App/ViewModels/Properties/HashesViewModel.cs (C#)

Code before:
			get => _selectedItem;
			set => SetProperty(ref _selectedItem, value);
		}

		public ObservableCollection<HashInfoItem> Hashes { get; set; }

		public Dictionary<string, bool> ShowHashes { get; private set; }

		public ICommand ToggleIsEnabledCommand { get; private set; }
		public ICommand CompareFileCommand { get; private set; }

		private ListedItem _item;

		private CancellationTokenSource _cancellationTokenSource;

		private string _hashInput;
		public string HashInput
		{
			get => _hashInput;
			set
			{
				SetProperty(ref _hashInput, value);

				OnHashInputTextChanged();
				OnPropertyChanged(nameof(IsInfoBarOpen));
				IsInfoBarOpen = !string.IsNullOrEmpty(value);
			}
		}

		private InfoBarSeverity _infoBarSeverity;
		public InfoBarSeverity InfoBarSeverity
		{
			get => _infoBarSeverity;
			set => SetProperty(ref _infoBarSeverity, value);
		}

		private string _infoBarTitle;
		public string InfoBarTitle
		{
			get => _infoBarTitle;
			set => SetProperty(ref _infoBarTitle, value);
		}

		private bool _isInfoBarOpen;
		public bool IsInfoBarOpen
		{
			get => _isInfoBarOpen;
			set => SetProperty(ref _isInfoBarOpen, value);
		}

		public HashesViewModel(ListedItem item)

Review comment (suggestion):
```suggestion
				OnHashInputTextChanged();
				OnPropertyChanged(nameof(IsInfoBarOpen));
```

Code after:
		private HashInfoItem _selectedItem;
		public HashInfoItem SelectedItem
		{
			get => _selectedItem;
			set => SetProperty(ref _selectedItem, value);
		}

		public ObservableCollection<HashInfoItem> Hashes { get; set; }

		public Dictionary<string, bool> ShowHashes { get; private set; }

		public ICommand ToggleIsEnabledCommand { get; private set; }
		public ICommand CompareFileCommand { get; private set; }

		private ListedItem _item;

		private CancellationTokenSource _cancellationTokenSource;

		private string _hashInput;
		public string HashInput
		{
			get => _hashInput;
			set
			{
				SetProperty(ref _hashInput, value);

				OnHashInputTextChanged();
				OnPropertyChanged(nameof(IsInfoBarOpen));
			}
		}

		private InfoBarSeverity _infoBarSeverity;
		public InfoBarSeverity InfoBarSeverity
		{
			get => _infoBarSeverity;
			set => SetProperty(ref _infoBarSeverity, value);
		}

		private string _infoBarTitle;
		public string InfoBarTitle
		{
			get => _infoBarTitle;
			set => SetProperty(ref _infoBarTitle, value);
		}

		public bool IsInfoBarOpen
			=> !string.IsNullOrEmpty(HashInput);

		public HashesViewModel(ListedItem item, AppWindow appWindow)
		{
			ToggleIsEnabledCommand = new RelayCommand<string>(ToggleIsEnabled);
Repository: files-community/Files
File: src/Files.App/ViewModels/Properties/HashesViewModel.cs (C#)

Code before:
			get => _hashInput;
			set
			{
				SetProperty(ref _hashInput, value);

				OnHashInputTextChanged();
				OnPropertyChanged(nameof(IsInfoBarOpen));
			}
		}

		private InfoBarSeverity _infoBarSeverity;
		public InfoBarSeverity InfoBarSeverity
		{
			get => _infoBarSeverity;
			set => SetProperty(ref _infoBarSeverity, value);
		}

		private string _infoBarTitle;
		public string InfoBarTitle
		{
			get => _infoBarTitle;
			set => SetProperty(ref _infoBarTitle, value);
		}

		public bool IsInfoBarOpen
		 => !string.IsNullOrEmpty(HashInput);

		public HashesViewModel(ListedItem item)
		{
			ToggleIsEnabledCommand = new RelayCommand<string>(ToggleIsEnabled);

			_item = item;
			_cancellationTokenSource = new();

			Hashes =
			[
				new() { Algorithm = "CRC32" },
				new() { Algorithm = "MD5" },
				new() { Algorithm = "SHA1" },
				new() { Algorithm = "SHA256" },
				new() { Algorithm = "SHA384" },
				new() { Algorithm = "SHA512" },
			];

			ShowHashes = UserSettingsService.GeneralSettingsService.ShowHashesDictionary ?? [];
			// Default settings
			ShowHashes.TryAdd("CRC32", true);
			ShowHashes.TryAdd("MD5", true);
			ShowHashes.TryAdd("SHA1", true);
			ShowHashes.TryAdd("SHA256", true);
			ShowHashes.TryAdd("SHA384", false);

Review comment (suggestion):
```suggestion
		public bool IsInfoBarOpen
			=> !string.IsNullOrEmpty(HashInput);
```

Code after:
		private string _hashInput;
		public string HashInput
		{
			get => _hashInput;
			set
			{
				SetProperty(ref _hashInput, value);

				OnHashInputTextChanged();
				OnPropertyChanged(nameof(IsInfoBarOpen));
			}
		}

		private InfoBarSeverity _infoBarSeverity;
		public InfoBarSeverity InfoBarSeverity
		{
			get => _infoBarSeverity;
			set => SetProperty(ref _infoBarSeverity, value);
		}

		private string _infoBarTitle;
		public string InfoBarTitle
		{
			get => _infoBarTitle;
			set => SetProperty(ref _infoBarTitle, value);
		}

		public bool IsInfoBarOpen
			=> !string.IsNullOrEmpty(HashInput);

		public HashesViewModel(ListedItem item, AppWindow appWindow)
		{
			ToggleIsEnabledCommand = new RelayCommand<string>(ToggleIsEnabled);

			_item = item;
			_appWindow = appWindow;
			_cancellationTokenSource = new();

			Hashes =
			[
				new() { Algorithm = "CRC32" },
				new() { Algorithm = "MD5" },
				new() { Algorithm = "SHA1" },
				new() { Algorithm = "SHA256" },
				new() { Algorithm = "SHA384" },
				new() { Algorithm = "SHA512" },
			];

			ShowHashes = UserSettingsService.GeneralSettingsService.ShowHashesDictionary ?? [];
			// Default settings
			ShowHashes.TryAdd("CRC32", true);
Repository: files-community/Files
File: src/Files.App/ViewModels/Properties/HashesViewModel.cs (C#)

Code before:
					}
					catch (IOException)
					{
						// File is currently open
						hashInfoItem.HashValue = Strings.CalculationErrorFileIsOpen.GetLocalizedResource();
					}
					catch (Exception)
					{
						hashInfoItem.HashValue = Strings.CalculationError.GetLocalizedResource();
					}
					finally
					{
						hashInfoItem.IsCalculating = false;
					}
				});
			}
		}

		public string FindMatchingAlgorithm(string hash)
		{
			if (string.IsNullOrEmpty(hash))
				return string.Empty;

			return Hashes
				.FirstOrDefault(h => h.HashValue?.Equals(hash, StringComparison.OrdinalIgnoreCase) == true)
				?.Algorithm ?? string.Empty;
		}

		public async Task<string> CalculateFileHashAsync(string filePath)
		{
			using var stream = File.OpenRead(filePath);
			using var md5 = MD5.Create();
			var hash = await Task.Run(() => md5.ComputeHash(stream));
			return BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant();
		}

		private void OnHashInputTextChanged()
		{
			string matchingAlgorithm = FindMatchingAlgorithm(HashInput);

			InfoBarSeverity = string.IsNullOrEmpty(matchingAlgorithm)
				? InfoBarSeverity.Error
				: InfoBarSeverity.Success;

			InfoBarTitle = string.IsNullOrEmpty(matchingAlgorithm)
				? Strings.HashesDoNotMatch.GetLocalizedResource()
				: string.Format(Strings.HashesMatch.GetLocalizedResource(), matchingAlgorithm);
		}

		private async Task OnCompareFileAsync()
		{

Review comment (suggestion):
```suggestion
			return Hashes.FirstOrDefault(h => h.HashValue?.Equals(hash, StringComparison.OrdinalIgnoreCase) == true)?.Algorithm ?? string.Empty;
```

Code after:
					}
					catch (IOException)
					{
						// File is currently open
						hashInfoItem.HashValue = Strings.CalculationErrorFileIsOpen.GetLocalizedResource();
					}
					catch (Exception)
					{
						hashInfoItem.HashValue = Strings.CalculationError.GetLocalizedResource();
					}
					finally
					{
						hashInfoItem.IsCalculating = false;
					}
				});
			}
		}

		public string FindMatchingAlgorithm(string hash)
		{
			if (string.IsNullOrEmpty(hash))
				return string.Empty;

			return Hashes.FirstOrDefault(h => h.HashValue?.Equals(hash, StringComparison.OrdinalIgnoreCase) == true)?.Algorithm ?? string.Empty;
		}

		public async Task<string> CalculateFileHashAsync(string filePath)
		{
			using var stream = File.OpenRead(filePath);
			using var md5 = MD5.Create();
			var hash = await Task.Run(() => md5.ComputeHash(stream));
			return BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant();
		}

		private void OnHashInputTextChanged()
		{
			string matchingAlgorithm = FindMatchingAlgorithm(HashInput);

			InfoBarSeverity = string.IsNullOrEmpty(matchingAlgorithm)
				? InfoBarSeverity.Error
				: InfoBarSeverity.Success;

			InfoBarTitle = string.IsNullOrEmpty(matchingAlgorithm)
				? Strings.HashesDoNotMatch.GetLocalizedResource()
				: string.Format(Strings.HashesMatch.GetLocalizedResource(), matchingAlgorithm);
		}

		private async Task OnCompareFileAsync()
		{
			var hWnd = Microsoft.UI.Win32Interop.GetWindowFromWindowId(_appWindow.Id);