C
C#3y 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
Temptica3y ago
does it successfully build? I've had erros before about binding not being possible. But when I build, it builds succefully
Halfbax
HalfbaxOP3y ago
It builds
Want results from more Discord servers?
Add your server