Hi Anirudhan,
Thank you for helping me find a solution. I am afraid though that your solution does not solve my problem entirely. Also, I prefer to stick to MVVM, so I prefer to have no code in the the View.cs except for the bare minimum.
I have updated and cleaned up my demo, and hope you will consider taking a second look at it. I also hope it will be clearer what I am after.
When you compile the code, you now see a 'Demo Button' on the Ribbon.
When you click this button, a usercontrol will load showing a person silhouette icon. When you next select a person name from the list, it will render some details of that person. It will update for every new person that is clicked in the person list.
I have reorganized my xaml usercontrols so that I will be able to reuse this bit of code (renamed to ClientHeaderView.xaml / ClientHeaderViewModel.cs) above different views (e.g. ContactDetailView and CareTrajectoryView), rather than trying to load these usercontrols below ClientHeaderView. I am unsure which approach is better, but I can't get either to work the way I would like to. A solution should include the ability to update the person's details in the ClientHeader when you select another person from the person list.
When you click the button directly right to "Demo Button" (it says Client), it will load the ContactDetailView. The ContactDetailView.xaml contains a contentcontrol in which I would like to render ClientHeaderView.xaml, including its ability to handle show the details of the selected person in the list. Now it only renders the silhouette icon.
App.xaml now contains two references to ClientHeaderView / ClientHeaderViewModel, since adding x:Key="" to the datatemplate made the 'Demo Button' click event only show the name of the object.
The datatemplate in App.xaml with x:Key="ClientHeader" is rendered above the ContactDetailView, but selecting a person from the list does not result in showing it's next to the person silhouette image. Probably because the content= is missing, but I was hoping that caliburn micro was going to be able to do this magic for me initially, but that unfortunately has not worked.
Thanks for any help you may be able to provide.
Kind regards,
Niels
Attachment:
SyncFusionDemoApp_bf7ad507.7z