I have xaml inside an xaml. The inside xaml has some bindings which are giving some problems. To explain here is my code
Main xaml
<TabItem Header="Configuration" DataContext="{Binding ComponentsVM}">
<Grid>
<ListBox ItemsSource="{Binding SomeList}" DisplayMemberPath="Name" SelectedItem="{Binding SomeComponent}" SelectedIndex="0"/>
<ig:MyInsideXamlElement Content="{Binding MyUserControl}" DataContext="{Binding}" />
</Grid>
</TabItem>
The inside xaml is
<Grid>
<TextBox Text="{Binding MySearchPath}"/>
</Grid>
The MyUserControl
property displays my binding of UserControl
without problems. But the MySearchPath
property does not get updated with entity framework class. I suspect the binding of my inner xaml(MySearchPath
) does not get resolved because the whole tab item's datacontext is ComponentsVM
. Is there any way to give a second datacontext to the inner xaml?