Click here to Skip to main content
15,905,325 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
We have a window where tabs will be added dynamically. Each tab has different view models and the window itself has mainviewmodel. Now i want to set one of the parent window's control with child tab's viewmodel. How to bind with childview model property?

Eg:
TabView- TabViewModel
View1-ViewModel1
View2-ViewModel2
View3-ViewModel3

Now i want to set visibility for an icon in the tab header for the first tab(View1) based on the property in ViewModel1.

Any suggestions?
Posted

1 solution

Set the DataContext of the parent window's view to the child tab's viewmodel
View1.DataContext = ViewModel3
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900