4. ContextMenu Challenge in WPF

The Productive C# Podcast - En podkast av Andrea Angella

Kategorier:

Learn how to use ContextMenu in WPF and how to bind a MenuItem to a command in your ViewModel using XAML. www.productivecsharp.com <ParentControl Tag="{Binding Path=DataContext">  <ParentControl.ContextMenu>    <ContextMenu>      <MenuItem Header="MyMenuItem" Command="{Binding Path=PlacementTarget.Tag.MyMenuItemHandler, RelativeSource={RelativeSource AncestorType={x:Type ContextMenu}}}" />    </ContextMenu>  </ParentControl.ContextMenu> </ParentControl>

Visit the podcast's native language site