I can get the master-detail scenario to work just fine if I keep the master and details together in the same view. However I want to be able to tailor the details presentation based on user security. Therefore I moved the detail section to a separate view using the same viewmodel as a backend. Now the details dont update properly when a new master record is selected. If the two view are using the same viewmodel, shouldnt this work just fine? Like I said when the code is together in the same view it works ok.
detail XAML:
<ListView x:Name="DoctorOfficesList"
Grid.Column="1"
Background="black"
HorizontalContentAlignment="Stretch"
IsSynchronizedWithCurrentItem="True"
ItemsSource="{Binding Path=SelectedDoctor.DoctorOfficesCollection}"
ItemTemplate="{StaticResource DoctorOfficesListTemplate}">
</ListView>
Master XAML:
<ListBox x:Name="DoctorHeaderList"
Grid.Column="0"
MinWidth="200"
MaxWidth="300"
Margin="0,0,2,0"
Background="black"
ItemsSource="{Binding Path=DoctorsList}"
SelectedItem="{Binding Path=SelectedDoctor}"
IsSynchronizedWithCurrentItem="True"
ItemTemplate="{StaticResource DoctorsListTemplate}"
ScrollViewer.HorizontalScrollBarVisibility="Hidden">
</ListBox>
I have tried several ways to get this to work. All scenarios work when the listboxes are in the same view. When moved separately they stop. If it matters I am using PRISMv2 as well.
I guess my specific question is how do I get this to work? Do i really need an event? I would think since they are tied to the same VM this would be a snap.