Skip to content

Commit a67cfd7

Browse files
Yu Leng (from Dev Box)claude
andcommitted
[KBM] Fix Action panel not showing for Text Expand trigger type
Manually sync SwitchPresenter.Value after programmatic ComboBox item changes, since WinUI binding on SelectedItem.Tag does not reliably update when items are cleared and replaced at runtime. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 679eb22 commit a67cfd7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/modules/keyboardmanager/KeyboardManagerEditorUI/Controls/UnifiedMappingControl.xaml.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,6 +1205,10 @@ private void SwitchActionTypeToReplaceWith()
12051205
ActionTypeComboBox.Items.Add(replaceWithItem);
12061206
ActionTypeComboBox.SelectedIndex = 0;
12071207
ActionTypeComboBox.IsEnabled = false;
1208+
1209+
// Manually update SwitchPresenter since programmatic ComboBox item changes
1210+
// may not reliably trigger the SelectedItem.Tag binding update in WinUI.
1211+
ActionSwitchPresenter.Value = "ReplaceWith";
12081212
}
12091213

12101214
private void RestoreNormalActionTypes()
@@ -1223,6 +1227,12 @@ private void RestoreNormalActionTypes()
12231227
_savedActionTypeItems = null;
12241228
ActionTypeComboBox.SelectedIndex = 0;
12251229
ActionTypeComboBox.IsEnabled = true;
1230+
1231+
// Manually sync SwitchPresenter with the restored first item's Tag.
1232+
if (ActionTypeComboBox.SelectedItem is ComboBoxItem selectedItem && selectedItem.Tag is string tag)
1233+
{
1234+
ActionSwitchPresenter.Value = tag;
1235+
}
12261236
}
12271237

12281238
#endregion

0 commit comments

Comments
 (0)