<Window x:Class="ModernBoxes.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ModernBoxes"
mc:Ignorable="d"
WindowStartupLocation="CenterScreen"
ResizeMode="NoResize"
MouseLeftButtonDown="Grid_MouseLeftButtonDown"
Background="Transparent"
xmlns:hc="https://handyorg.github.io/handycontrol"
x:Name="window"
Title="MainWindow" Height="800" Width="800">
<hc:Card hc:BorderElement.CornerRadius="20" Background="White" Effect="{StaticResource EffectShadow1}">
<hc:Card.ContextMenu>
<ContextMenu>
<MenuItem Header="展开"/>
<MenuItem Header="收缩"/>
<MenuItem Header="关闭" Command="{Binding WindowClose}"
CommandParameter="{
Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ContextMenu}
,Path=PlacementTarget}"/>
</ContextMenu>
</hc:Card.ContextMenu>
</hc:Card>
</Window>
MenuItem 的CommandParameter怎么绑定Window对象