How to redirect bindings to "outside" of a XAML control <p>Let's say I have a <strong>ListView</strong> with a <strong>ContextMenu</strong>. I'd like to use it as a separate control called <strong>ListViewWithContextMenu</strong>. How can I redirect the command bindings from ContextMenu so they're visible in <strong>ListViewWithContextMenu</strong>?</p> <p>Example code:</p> <p><strong>ListViewWithContextMenu.xaml</strong></p> <pre><code>&lt;ListView x:Class="WpfApplication4.ListViewWithContextMenu" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:WpfApplication4" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"&gt; &lt;ListView.ContextMenu&gt; &lt;ContextMenu&gt; &lt;MenuItem Command="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:ListViewWithContextMenu}}, Path= PreviewCommand}" /&gt; &lt;/ContextMenu&gt; &lt;/ListView.ContextMenu&gt; </code></pre> <p></p> <p><strong>ListViewWithContextMenu.xaml.cs</strong></p> <pre><code>using System.Windows; using System.Windows.Input; namespace WpfApplication4 { public partial class ListViewWithContextMenu { public ICommand PreviewCommand { get { return (ICommand)GetValue(PreviewCommandProperty); } set { SetValue(PreviewCommandProperty, value); } } public static readonly DependencyProperty PreviewCommandProperty = DependencyProperty.Register("PreviewCommand", typeof(ICommand), typeof(ListViewWithContextMenu)); public ListViewWithContextMenu() { InitializeComponent(); } } } </code></pre> <p><strong>MainWindow.xaml</strong></p> <pre><code>&lt;Window x:Class="WpfApplication4.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:WpfApplication4" mc:Ignorable="d" Title="MainWindow" Height="350" Width="525"&gt; &lt;Window.DataContext&gt;&lt;local:MainWidnowViewModel&gt;&lt;/local:MainWidnowViewModel&gt;&lt;/Window.DataContext&gt; &lt;Grid&gt; &lt;local:ListViewWithContextMenu PreviewCommand="{Binding Preview}"&gt;&lt;/local:ListViewWithContextMenu&gt; &lt;/Grid&gt; &lt;/Window&gt; </code></pre> <p><strong>MainWindowViewModel.cs</strong></p> <pre><code>using System.Windows; using System.Windows.Input; using Microsoft.Practices.Prism.Commands; namespace WpfApplication4 { public class MainWidnowViewModel { public MainWidnowViewModel() { Preview = new DelegateCommand(PreviewMethod); } private void PreviewMethod() { MessageBox.Show("PREVIEW"); } public ICommand Preview { get; set; } } } </code></pre> <p>This code does not call the PreviewMethod in ViewModel which I want to achive</p>