2012-02-21 71 views
2

我有一個WPF網格,其中每一行代表磁盤上的文件。如何使用文件在網格中顯示文件上下文菜單

grid

我希望做的是;當某人右鍵單擊一行以顯示與Windows資源管理器顯示的相同的上下文菜單時。任何想法如何實現這一點?我希望這將是相對容易的,但不知道從哪裏開始。

enter image description here

+0

可能的複製http://stackoverflow.com/questions/451287/how-do-you-show-the-windows-explorer-context-菜單從-AC鋒利的應用 – 2012-02-21 07:05:02

回答

0

一些線索......

<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> 
相關問題