我要实现这样一个功能
<ContextMenu x:Key="ContextMenuColoum"> <MenuItem Header="复制" Tag="{Binding 这里我要绑定父元素的Text属性值}" Click="MenCopy_Click" > <MenuItem.CommandBindings> <CommandBinding CanExecute="CommandBinding_CanExecute" Executed="CommandBinding_Executed" Command="Copy"> </CommandBinding> </MenuItem.CommandBindings> </MenuItem> </ContextMenu> <DataTemplate x:Key="dataTemplateName"> <TextBlock Text="{Binding Name}" ContextMenu="{ StaticResource ContextMenuColoum}"> </TextBlock> </DataTemplate>
智慧大石