WPF: Bind to command from ControlTemplate
I am trying to add a button to a custom ListView (MyListView) which triggers a command (MyCustomCommand) defined in MyListView. I have added the button (and a title text) by applying a ControlTemplate. The problem is that I have not found a way to trigger MyCustomCommand when clicking the button. What I eventually want to achieve is to open a Popup or ContextMenu where I can select which columns should be visible in the ListView. Here's my template source: <Style TargetType="local:MyListView"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="local:MyListView"> <Border