Repository: files-community/Files
File: src/Files.App/Dialogs/CreateArchiveDialog.xaml.cs (C#)

Code before:

			FileNameBox.SelectionStart = FileNameBox.Text.Length;
			FileNameBox.Focus(FocusState.Programmatic);
		}
		private void ContentDialog_Closing(ContentDialog _, ContentDialogClosingEventArgs e)
		{
			InvalidNameWarning.IsOpen = false;
			Closing -= ContentDialog_Closing;
			ViewModel.PropertyChanged -= ViewModel_PropertyChanged;

			if (e.Result is ContentDialogResult.Primary)
				canCreate = true;
		}

		private void PasswordBox_Loading(FrameworkElement _, object e)
			=> PasswordBox.Focus(FocusState.Programmatic);

		private void ViewModel_PropertyChanged(object? _, PropertyChangedEventArgs e)
		{
			if (e.PropertyName is nameof(DialogViewModel.UseEncryption) && ViewModel.UseEncryption)
				PasswordBox.Focus(FocusState.Programmatic);
		}

		private sealed class DialogViewModel : ObservableObject
		{
			private readonly IGeneralSettingsService GeneralSettingsService = Ioc.Default.GetRequiredService<IGeneralSettingsService>();
			public bool IsNameValid => FilesystemHelpers.IsValidForFilename(fileName);

			public bool ShowNameWarning => !string.IsNullOrEmpty(fileName) && !IsNameValid;

			private string fileName = string.Empty;
			public string FileName
			{
				get => fileName;
				set
				{
					if (SetProperty(ref fileName, value))
					{
						OnPropertyChanged(nameof(IsNameValid));
						OnPropertyChanged(nameof(ShowNameWarning));
					}
				}
			}

			public FileFormatItem FileFormat
			{
				get => FileFormats.First(format => format.Key == GeneralSettingsService.ArchiveFormatsOption);
				set
				{
					if (value.Key != GeneralSettingsService.ArchiveFormatsOption)
					{

Review comment (suggestion):
```suggestion
			private readonly IGeneralSettingsService GeneralSettingsService = Ioc.Default.GetRequiredService<IGeneralSettingsService>();

```

Code after:

			FileNameBox.SelectionStart = FileNameBox.Text.Length;
			FileNameBox.Focus(FocusState.Programmatic);
		}
		private void ContentDialog_Closing(ContentDialog _, ContentDialogClosingEventArgs e)
		{
			InvalidNameWarning.IsOpen = false;
			Closing -= ContentDialog_Closing;
			ViewModel.PropertyChanged -= ViewModel_PropertyChanged;

			if (e.Result is ContentDialogResult.Primary)
				canCreate = true;
		}

		private void PasswordBox_Loading(FrameworkElement _, object e)
			=> PasswordBox.Focus(FocusState.Programmatic);

		private void ViewModel_PropertyChanged(object? _, PropertyChangedEventArgs e)
		{
			if (e.PropertyName is nameof(DialogViewModel.UseEncryption) && ViewModel.UseEncryption)
				PasswordBox.Focus(FocusState.Programmatic);
		}

		private sealed class DialogViewModel : ObservableObject
		{
			private readonly IGeneralSettingsService GeneralSettingsService = Ioc.Default.GetRequiredService<IGeneralSettingsService>();

			public bool IsNameValid => FilesystemHelpers.IsValidForFilename(fileName);

			public bool ShowNameWarning => !string.IsNullOrEmpty(fileName) && !IsNameValid;

			private string fileName = string.Empty;
			public string FileName
			{
				get => fileName;
				set
				{
					if (SetProperty(ref fileName, value))
					{
						OnPropertyChanged(nameof(IsNameValid));
						OnPropertyChanged(nameof(ShowNameWarning));
					}
				}
			}

			public FileFormatItem FileFormat
			{
				get => FileFormats.First(format => format.Key == GeneralSettingsService.ArchiveFormatsOption);
				set
				{
					if (value.Key != GeneralSettingsService.ArchiveFormatsOption)