Context Menu Binding to Parent Window's Datacontext
I have a TreeListControl that binds to a collection in my VM. I also want to define the context menu inside the treelistcontrol having its header text bind to another string in my VM. how can I set the data context in this case? I tried to <Window.DataContext> <model:ViewModel></model:ViewModel> </Window.DataContext> <Grid> <Button Grid.Row="1" Command="{Binding CellCheckedCommand}"></Button> <TextBlock Text="{Binding HeaderText}" Grid.Row="2"> <TextBlock.ContextMenu> <ContextMenu> <MenuItem DataContext="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, Path=DataContext}"