C
C#2y ago
Halfbax

XAML Binding error, cannot find source

Hello, I do get a binding error when trying to bind a string from codebehind as content of a ComboBoxItem in CompositeCollection.
<ComboBox.ItemsSource>
<CompositeCollection>
<ComboBoxItem Visibility="Collapsed" Content="{Binding Test, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MultiSelectionDropdown}}}"/>
<CollectionContainer Collection="{Binding Source={StaticResource ResourceKey=Pipeline}}"/>
</CompositeCollection>
</ComboBox.ItemsSource>
<ComboBox.ItemsSource>
<CompositeCollection>
<ComboBoxItem Visibility="Collapsed" Content="{Binding Test, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MultiSelectionDropdown}}}"/>
<CollectionContainer Collection="{Binding Source={StaticResource ResourceKey=Pipeline}}"/>
</CompositeCollection>
</ComboBox.ItemsSource>
I am trying to bind Test.
2 Replies
Temptica
Temptica2y ago
does it successfully build? I've had erros before about binding not being possible. But when I build, it builds succefully
Halfbax
Halfbax2y ago
It builds