I have a custom control embedded within a TabItem of the TabControl. TabControl is Content of main Usercontrol as follows:
<UserControl x:Class="ControlsLibrary.wpf.Alerts.UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="300" Width="300">
<Grid>
<TabControl DataContext="{Binding Filter}">
<TabItem>
<mc:CustomControl DataContext="{Binding Options}"
</TabItem>
</TabControl>
</Grid>
</UserControl>
What I understand is my custom control will inherit DataContext of TabControl, therefore DataContext of my custom control should be set to the "Options" property of Filter object which is DataContext of TabControl. However, Visual Studio's output window indicates that it is looking for Options in DataContext of parent UserControl.
Even if I use ElementName property of the Binding class, I still cannot get DataContext of my custom control to change, even though property "Filter" of data item implements INotifyPropertyChanged.
What did I miss?
TIA.