c# - Add different types or UserControl in ItemControl -


i using itemcontrol in xaml code , it's itemsource bound list of mycustomusercontrol.

i use catel mvvm framework

my question : have second type of usercontrol it's own view , viewmodel. possible bind itemsource of itemcontrol 2 types of usercontrols ? if it's possible, how specify in itemcontrol datatemplate different possible views of 2 usercontrols.

here code of itemcontrol :

<itemscontrol itemssource="{binding mycustomusercontrol}">         <itemscontrol.itemtemplate>             <datatemplate>             <views:mycustomusercontrolview/>             </datatemplate>         </itemscontrol.itemtemplate>         <itemscontrol.itemspanel>             <itemspaneltemplate>                 <stackpanel orientation="horizontal" />             </itemspaneltemplate>         </itemscontrol.itemspanel>     </itemscontrol> 

thank !


Comments

Popular posts from this blog

java - BeanIO write annotated class to fixedlength -

Using Java 8 lambdas/transformations to combine and flatten two Maps -

How to connect android app to App engine -