How to add controls in the tab item programmatically in wpf with MVVM

前端 未结 3 1226
后悔当初
后悔当初 2021-02-06 17:05

I have created a tab control and Created the tabItems dynamically, but i dont know how to add controls into the tabItems using MVVM. Could any one help me

3条回答
  •  逝去的感伤
    2021-02-06 17:34

    you dont have to add controls if you use mvvm. you just have to create datatemplates for your viewmodel objects you wanna display.

    all you need is a contentcontrol/presenter which is bind to your viewmodel and the datatemplate will show what you want.

提交回复
热议问题