gpt4 book ai didi

c# - 如何在包含文件的网格中显示文件上下文菜单

转载 作者:太空宇宙 更新时间:2023-11-03 16:35:00 25 4
gpt4 key购买 nike

我有一个 WPF 网格,其中每一行代表磁盘上的一个文件。

grid

我想做的是;当有人右键单击一行以显示与 Windows 资源管理器显示相同的上下文菜单时。任何想法如何实现这个?我希望这会相对容易,但不确定从哪里开始。

enter image description here

最佳答案

一些线索...

<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>

关于c# - 如何在包含文件的网格中显示文件上下文菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9373008/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com