diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Library/ViewModels/ImageResizerViewModel.cs b/src/core/Microsoft.PowerToys.Settings.UI.Library/ViewModels/ImageResizerViewModel.cs index fcede542e8..a875bef97b 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Library/ViewModels/ImageResizerViewModel.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI.Library/ViewModels/ImageResizerViewModel.cs @@ -86,6 +86,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels private bool _keepDateModified; private int _encoderGuidId; + public bool IsListViewFocusRequested { get; set; } + public bool IsEnabled { get @@ -257,6 +259,9 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels imageSizes.Add(newSize); _advancedSizes = imageSizes; SavesImageSizes(imageSizes); + + // Set the focus requested flag to indicate that an add operation has occurred during the ContainerContentChanging event + IsListViewFocusRequested = true; } public void DeleteImageSize(int id) diff --git a/src/core/Microsoft.PowerToys.Settings.UI/Views/ImageResizerPage.xaml b/src/core/Microsoft.PowerToys.Settings.UI/Views/ImageResizerPage.xaml index 5032456db1..c43e3a974f 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI/Views/ImageResizerPage.xaml +++ b/src/core/Microsoft.PowerToys.Settings.UI/Views/ImageResizerPage.xaml @@ -65,7 +65,8 @@ SelectionMode="None" ScrollViewer.HorizontalScrollMode="Enabled" ScrollViewer.HorizontalScrollBarVisibility="Auto" - ScrollViewer.IsHorizontalRailEnabled="True"> + ScrollViewer.IsHorizontalRailEnabled="True" + ContainerContentChanging="ImagesSizesListView_ContainerContentChanging">