My view model currently contains a “SelectedClient” property which refers to the selected “Client” object in a datagrid. This selected client property contains a property titled “OfficeLocations” which is essentially just a list of “OfficeLocation” objects.
I am trying to bind a listbox to the SelectedClients.OfficeLocations property like so:
<ListBox ItemsSource="{Binding SelectedClient.OfficeLocations}" />
But for some reason the ListBox always shows up blank. Once again, in debug mode when I view the SelectedClient.OfficeLocations property, it does in fact contain data.
I’ve also tried something like:
<ListBox ItemsSource="{Binding SelectedClient, Path=OfficeLocations}" />
To no avail.
Any ideas would be greatly appreciated..Thanks!
Ahh, so it turns out that I was trying to do this binding with a DataGrid.RowDetailsTemplate which overrides my DataContext to SelectedItem already…meaning changing my binding to look like:
Fixed the issue!