From d28f1b45e55b18632e600dd93ffeb5f16a4675a9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Mar 2026 01:45:27 +0000 Subject: [PATCH 1/2] Initial plan From 28a021d685279d0adc153c8ebffbd9b8fff688d4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Mar 2026 01:50:35 +0000 Subject: [PATCH 2/2] Fix 5 review comments: shortcut cap, ItemsDictionary clear, null ItemsSource, duplicate handlers, Freeform key hint Co-authored-by: TheJoeFin <7809853+TheJoeFin@users.noreply.github.com> --- Text-Grab/Controls/InlineChipElement.cs | 14 ++++++++++++-- Text-Grab/Controls/InlinePickerRichTextBox.cs | 2 +- Text-Grab/Views/FullscreenGrab.xaml | 2 +- Text-Grab/Views/FullscreenGrab.xaml.cs | 2 +- Text-Grab/Views/QuickSimpleLookup.xaml.cs | 1 + 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Text-Grab/Controls/InlineChipElement.cs b/Text-Grab/Controls/InlineChipElement.cs index da12f279..beab9d6b 100644 --- a/Text-Grab/Controls/InlineChipElement.cs +++ b/Text-Grab/Controls/InlineChipElement.cs @@ -31,6 +31,8 @@ public string Value public event EventHandler? RemoveRequested; + private Button? _removeButton; + static InlineChipElement() { DefaultStyleKeyProperty.OverrideMetadata( @@ -42,7 +44,15 @@ public override void OnApplyTemplate() { base.OnApplyTemplate(); - if (GetTemplateChild(PartRemoveButton) is Button removeButton) - removeButton.Click += (s, e) => RemoveRequested?.Invoke(this, EventArgs.Empty); + if (_removeButton is not null) + _removeButton.Click -= RemoveButton_Click; + + _removeButton = GetTemplateChild(PartRemoveButton) as Button; + + if (_removeButton is not null) + _removeButton.Click += RemoveButton_Click; } + + private void RemoveButton_Click(object sender, RoutedEventArgs e) + => RemoveRequested?.Invoke(this, EventArgs.Empty); } diff --git a/Text-Grab/Controls/InlinePickerRichTextBox.cs b/Text-Grab/Controls/InlinePickerRichTextBox.cs index a3c34dbe..0957745d 100644 --- a/Text-Grab/Controls/InlinePickerRichTextBox.cs +++ b/Text-Grab/Controls/InlinePickerRichTextBox.cs @@ -50,7 +50,7 @@ public class InlinePickerRichTextBox : RichTextBox public IEnumerable ItemsSource { - get => (IEnumerable)GetValue(ItemsSourceProperty); + get => (IEnumerable?)GetValue(ItemsSourceProperty) ?? []; set => SetValue(ItemsSourceProperty, value); } diff --git a/Text-Grab/Views/FullscreenGrab.xaml b/Text-Grab/Views/FullscreenGrab.xaml index 90717c49..35902a56 100644 --- a/Text-Grab/Views/FullscreenGrab.xaml +++ b/Text-Grab/Views/FullscreenGrab.xaml @@ -95,7 +95,7 @@ x:Name="FreeformSelectionMenuItem" Click="SelectionStyleMenuItem_Click" Header="Freeform - Draw any shape" - InputGestureText="P" + InputGestureText="D" IsCheckable="True" Tag="Freeform" />