How do I load controls in different ContentControls of a Shell using CaliburnMicro

后端 未结 3 960
渐次进展
渐次进展 2020-12-18 00:47

By default when you use \"ActivateItem(new Control());\" your control is loaded into a ContentControl which with the name ActiveItem, fro example. . If I have multiple conte

3条回答
  •  自闭症患者
    2020-12-18 01:37

    If the ViewModel that gets binded to the UI contains a property with the name that matches a content control. The Content control view automatically gets resolved the the view supported by this property, provided this property itself is a ViewModel type and has been registed with Ioc container. For example

    
    

    If there is a property LoginStatus on the main ViewModel (LoginStatus property itself is a ViewModel). The content control would correctly get rendered with the appropriate view.

提交回复
热议问题