I'm not even sure how to express this, so im very sorry if the title is confusing.. My XAML (simplified) looks like this:
<UserControl x:Class="PBA.Application.Client.UserControls.UserControls.FreqReserve.OverView" xmlns:FreqReserve="clr-namespace:PBA.Application.Client.UserControls.UserControls.FreqReserve">
...
<DockPanel>
<UserControls:LegendControl>
<UserControls:LegendControl.Items>
<UserControls:LegendItem Visibility="{Binding Path=IsDirtyVisible, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type FreqReserve:OverView}}, Converter={StaticResource btvc}}" Identifier="Pink" Text="Ikke sendt"></UserControls:LegendItem>
<UserControls:LegendItem Identifier="Yellow" Text="Sendt"></UserControls:LegendItem>
<UserControls:LegendItem Identifier="LightGreen" Text="Accepteret"></UserControls:LegendItem>
<UserControls:LegendItem Identifier="White" Text="Ikke accepteret"></UserControls:LegendItem>
</UserControls:LegendControl.Items>
</UserControls:LegendControl>
</DockPanel>
</UserControl>
where the LegendItem list is templated inside the legendcontrol.
The binding expression fails with a System.Windows.Data Error: 4. I've tried using elementname instead, with the same results. I'm guessing it has something to do with the LegendItems not actually being directly in the Visual tree but i have no idea (WPF rookie, i know). What am i doing wrong?