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

Code before:
				e.DragUIOverride.Caption = string.Format("OpenInNewTab".GetLocalizedResource());
				e.AcceptedOperation = DataPackageOperation.Link;
				deferral.Complete();
			}
			catch { }
		}

		public override DependencyObject ContainerFromItem(ITabBarItem item)
		{
			return HorizontalTabView.ContainerFromItem(item);
		}

		private void TabViewItem_Loaded(object sender, RoutedEventArgs e)
		{
			if (sender is TabViewItem tvi && tvi.FindDescendant("IconControl") is ContentControl control)
			{
				control.Content = (tvi.IconSource as ImageIconSource)?.CreateIconElement();
				tvi.RegisterPropertyChangedCallback(TabViewItem.IconSourceProperty, (s, args) =>
				{
					if (s is TabViewItem tabViewItem && tabViewItem.FindDescendant("IconControl") is ContentControl iconControl)
						iconControl.Content = (tabViewItem.IconSource as ImageIconSource)?.CreateIconElement();
				});
			}
		}

		private async void DragAreaRectangle_Loaded(object? sender, RoutedEventArgs e)
		{
			if (HorizontalTabView.ActualWidth <= 0 && TabBarAddNewTabButton.Width <= 0)
				await Task.Delay(100);

			var titleBarInset = ((FilePropertiesHelpers.FlowDirectionSettingIsRightToLeft
				? MainWindow.Instance.AppWindow.TitleBar.LeftInset
				: MainWindow.Instance.AppWindow.TitleBar.RightInset) / DragAreaRectangle.XamlRoot.RasterizationScale) + 40;

			RightPaddingColumn.Width = new(titleBarInset > 40 ? titleBarInset : 138);
			HorizontalTabView.Measure(new(
				HorizontalTabView.ActualWidth - TabBarAddNewTabButton.Width - titleBarInset,
				HorizontalTabView.ActualHeight));
		}
	}
}

Review comment (suggestion):
```suggestion
		private async void DragAreaRectangle_Loaded(object sender, RoutedEventArgs e)
```

Code after:
				e.DragUIOverride.Caption = string.Format("OpenInNewTab".GetLocalizedResource());
				e.AcceptedOperation = DataPackageOperation.Link;
				deferral.Complete();
			}
			catch { }
		}

		public override DependencyObject ContainerFromItem(ITabBarItem item)
		{
			return HorizontalTabView.ContainerFromItem(item);
		}

		private void TabViewItem_Loaded(object sender, RoutedEventArgs e)
		{
			if (sender is TabViewItem tvi && tvi.FindDescendant("IconControl") is ContentControl control)
			{
				control.Content = (tvi.IconSource as ImageIconSource)?.CreateIconElement();
				tvi.RegisterPropertyChangedCallback(TabViewItem.IconSourceProperty, (s, args) =>
				{
					if (s is TabViewItem tabViewItem && tabViewItem.FindDescendant("IconControl") is ContentControl iconControl)
						iconControl.Content = (tabViewItem.IconSource as ImageIconSource)?.CreateIconElement();
				});
			}
		}

		private async void DragAreaRectangle_Loaded(object sender, RoutedEventArgs e)
		{
			if (HorizontalTabView.ActualWidth <= 0 && TabBarAddNewTabButton.Width <= 0)
				await Task.Delay(100);

			var titleBarInset = ((FilePropertiesHelpers.FlowDirectionSettingIsRightToLeft
				? MainWindow.Instance.AppWindow.TitleBar.LeftInset
				: MainWindow.Instance.AppWindow.TitleBar.RightInset) / DragAreaRectangle.XamlRoot.RasterizationScale) + 40;

			RightPaddingColumn.Width = new(titleBarInset > 40 ? titleBarInset : 138);
			HorizontalTabView.Measure(new(
				HorizontalTabView.ActualWidth - TabBarAddNewTabButton.Width - titleBarInset,
				HorizontalTabView.ActualHeight));
		}
	}
}