From 9089ca2eded7c2d315855d52b6f115ea259d6fc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Pol=C3=A1=C5=A1ek?= Date: Tue, 3 Mar 2026 11:46:23 +0100 Subject: [PATCH] CmdPal: Expand Binding markup extensions to nested elements to avoid WMC1510 (#45830) ## Summary of the Pull Request This PR expands all Binding XAML markup expressions to nested elements, which in turn prevents compiler from generating `WMC1510 Ensure the property path is trimming and AOT compatible` warnings. ## PR Checklist - [x] Related to: #42574 --- .../Controls/ColorPalette.xaml | 6 +- .../Controls/ContextMenu.xaml | 20 ++++- .../Microsoft.CmdPal.UI/Controls/Tag.xaml | 10 ++- .../Styles/TeachingTip.xaml | 20 ++++- .../Microsoft.CmdPal.UI/Styles/TextBox.xaml | 73 ++++++++++++++++--- 5 files changed, 112 insertions(+), 17 deletions(-) diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI/Controls/ColorPalette.xaml b/src/modules/cmdpal/Microsoft.CmdPal.UI/Controls/ColorPalette.xaml index 105010bbd2..b225fba6da 100644 --- a/src/modules/cmdpal/Microsoft.CmdPal.UI/Controls/ColorPalette.xaml +++ b/src/modules/cmdpal/Microsoft.CmdPal.UI/Controls/ColorPalette.xaml @@ -193,7 +193,11 @@ SelectionMode="None"> - + + + + + diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI/Controls/ContextMenu.xaml b/src/modules/cmdpal/Microsoft.CmdPal.UI/Controls/ContextMenu.xaml index 5035016117..62f18ef63a 100644 --- a/src/modules/cmdpal/Microsoft.CmdPal.UI/Controls/ContextMenu.xaml +++ b/src/modules/cmdpal/Microsoft.CmdPal.UI/Controls/ContextMenu.xaml @@ -53,7 +53,15 @@ TextTrimming="WordEllipsis" TextWrapping="NoWrap"> - + + + + + - + + + + + + SourceKey="{TemplateBinding Icon}"> + + + + - + + + + + - + + + + + diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI/Styles/TextBox.xaml b/src/modules/cmdpal/Microsoft.CmdPal.UI/Styles/TextBox.xaml index 167636e8ec..52531d03ac 100644 --- a/src/modules/cmdpal/Microsoft.CmdPal.UI/Styles/TextBox.xaml +++ b/src/modules/cmdpal/Microsoft.CmdPal.UI/Styles/TextBox.xaml @@ -158,12 +158,24 @@ Grid.ColumnSpan="1" Margin="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" - Foreground="{Binding PlaceholderForeground, RelativeSource={RelativeSource TemplatedParent}, TargetNullValue={ThemeResource TextControlPlaceholderForeground}}" IsHitTestVisible="False" Text="{TemplateBinding PlaceholderText}" TextAlignment="{TemplateBinding TextAlignment}" - TextWrapping="{TemplateBinding TextWrapping}" - Visibility="{Binding Description, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ReverseStringVisibilityConverter}, Mode=OneWay}" /> + TextWrapping="{TemplateBinding TextWrapping}"> + + + + + + +