Skip to content

Nested Binding in ItemsControl #17320

Answered by IanRawley
sikelio asked this question in Q&A
Discussion options

You must be logged in to vote

ItemsSource="{Binding $parent[viewModels:ProfilesPageViewModel].SessionList}"

This won't work, because the $parent binding selects controls, not their DataContext. You'll need to change it to
ItemsSource="{Binding $parent[ProfilesPageView].((viewModels:ProfilesPageViewModel)DataContext).SessionList}"
or similar (fixing namespaces, etc), selecting a control and then casting its DataContext to the appropriate type.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sikelio
Comment options

Answer selected by sikelio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants