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

Code before:
using CommunityToolkit.WinUI.Controls;
using Microsoft.Extensions.Logging;
using Microsoft.UI.Dispatching;
using Microsoft.UI.Input;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Navigation;
using Windows.ApplicationModel;
using Windows.Foundation.Metadata;
using Windows.Graphics;
using Windows.Services.Store;
using WinRT.Interop;
using VirtualKey = Windows.System.VirtualKey;
using GridSplitter = Files.App.Controls.GridSplitter;
using Files.App.Controls;
using Microsoft.UI.Xaml.Media;

namespace Files.App.Views
{
	public sealed partial class MainPage : Page
	{
		private IGeneralSettingsService generalSettingsService { get; } = Ioc.Default.GetRequiredService<IGeneralSettingsService>();
		public IUserSettingsService UserSettingsService { get; }
		private readonly IWindowContext WindowContext = Ioc.Default.GetRequiredService<IWindowContext>();
		public ICommandManager Commands { get; } = Ioc.Default.GetRequiredService<ICommandManager>();
		public SidebarViewModel SidebarAdaptiveViewModel { get; }
		public MainPageViewModel ViewModel { get; }

		private bool keyReleased = true;

		private DispatcherQueueTimer _updateDateDisplayTimer;

		public MainPage()
		{
			InitializeComponent();

			// Dependency Injection
			UserSettingsService = Ioc.Default.GetRequiredService<IUserSettingsService>();
			SidebarAdaptiveViewModel = Ioc.Default.GetRequiredService<SidebarViewModel>();
			SidebarAdaptiveViewModel.PaneFlyout = (MenuFlyout)Resources["SidebarContextMenu"];
			ViewModel = Ioc.Default.GetRequiredService<MainPageViewModel>();

			if (FilePropertiesHelpers.FlowDirectionSettingIsRightToLeft)
				FlowDirection = FlowDirection.RightToLeft;

			ViewModel.PropertyChanged += ViewModel_PropertyChanged;
			UserSettingsService.OnSettingChangedEvent += UserSettingsService_OnSettingChangedEvent;

			_updateDateDisplayTimer = DispatcherQueue.CreateTimer();
			_updateDateDisplayTimer.Interval = TimeSpan.FromSeconds(1);

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

Code after:
using CommunityToolkit.WinUI.Controls;
using Microsoft.Extensions.Logging;
using Microsoft.UI.Dispatching;
using Microsoft.UI.Input;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Navigation;
using Windows.ApplicationModel;
using Windows.Foundation.Metadata;
using Windows.Graphics;
using Windows.Services.Store;
using WinRT.Interop;
using VirtualKey = Windows.System.VirtualKey;
using GridSplitter = Files.App.Controls.GridSplitter;
using Files.App.Controls;
using Microsoft.UI.Xaml.Media;

namespace Files.App.Views
{
	public sealed partial class MainPage : Page
	{
		private IGeneralSettingsService generalSettingsService { get; } = Ioc.Default.GetRequiredService<IGeneralSettingsService>();
		public IUserSettingsService UserSettingsService { get; }
		private readonly IWindowContext WindowContext = Ioc.Default.GetRequiredService<IWindowContext>();
		private readonly ICommandManager Commands = Ioc.Default.GetRequiredService<ICommandManager>();
		public SidebarViewModel SidebarAdaptiveViewModel { get; }
		public MainPageViewModel ViewModel { get; }

		private bool keyReleased = true;

		private DispatcherQueueTimer _updateDateDisplayTimer;

		public MainPage()
		{
			InitializeComponent();

			// Dependency Injection
			UserSettingsService = Ioc.Default.GetRequiredService<IUserSettingsService>();
			SidebarAdaptiveViewModel = Ioc.Default.GetRequiredService<SidebarViewModel>();
			SidebarAdaptiveViewModel.PaneFlyout = (MenuFlyout)Resources["SidebarContextMenu"];
			ViewModel = Ioc.Default.GetRequiredService<MainPageViewModel>();

			if (FilePropertiesHelpers.FlowDirectionSettingIsRightToLeft)
				FlowDirection = FlowDirection.RightToLeft;

			ViewModel.PropertyChanged += ViewModel_PropertyChanged;
			UserSettingsService.OnSettingChangedEvent += UserSettingsService_OnSettingChangedEvent;

			_updateDateDisplayTimer = DispatcherQueue.CreateTimer();
			_updateDateDisplayTimer.Interval = TimeSpan.FromSeconds(1);