C# 如何在包含文件的网格中显示文件上下文菜单
我有一个WPF网格,其中每一行代表磁盘上的一个文件 我想做的是;当某人右键单击某行时,显示与Windows资源管理器相同的上下文菜单。有什么办法可以实现吗?我希望这将是相对容易的,但不知道从哪里开始 一些线索C# 如何在包含文件的网格中显示文件上下文菜单,c#,.net,wpf,grid,C#,.net,Wpf,Grid,我有一个WPF网格,其中每一行代表磁盘上的一个文件 我想做的是;当某人右键单击某行时,显示与Windows资源管理器相同的上下文菜单。有什么办法可以实现吗?我希望这将是相对容易的,但不知道从哪里开始 一些线索 <Window.Resources> <Style TargetType="DataGridRow"> <Setter Property="ContextMenu"> <Set
<Window.Resources>
<Style TargetType="DataGridRow">
<Setter Property="ContextMenu">
<Setter.Value>
<ContextMenu>
<ContextMenu.Template>
<ControlTemplate>
<TextBox Text="{Binding <the property with which column is bound to>}" Height="30" Width="40" />
</ControlTemplate>
</ContextMenu.Template>
</ContextMenu>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
一些线索
<Window.Resources>
<Style TargetType="DataGridRow">
<Setter Property="ContextMenu">
<Setter.Value>
<ContextMenu>
<ContextMenu.Template>
<ControlTemplate>
<TextBox Text="{Binding <the property with which column is bound to>}" Height="30" Width="40" />
</ControlTemplate>
</ContextMenu.Template>
</ContextMenu>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
可能重复可能重复