2012-02-21 3 views
2

各行がディスク上のファイルを表すWPFグリッドがあります。私はやってみたい何ファイルのグリッドにファイルのコンテキストメニューを表示する方法

grid

。誰かが行を右クリックしてWindows Explorerと同じコンテキストメニューを表示すると、どのようにこれを実装するためのアイデア?私はそれが相対的に簡単だが、これでどこから始めるべきか分からないことを望んでいる。

enter image description here

+0

可能な重複http://stackoverflow.com/questions/451287/how-do-you-show-the-windows-explorer-context-メニューから-AC-シャープアプリケーション –

答えて

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> 
関連する問題