How to load controls in different ContentControls shell using CaliburnMicro

By default, when you use ActivateItem (new control ()); your control is loaded into the ContentControl with the name ActiveItem, for example. If I have several content controls on my page, how can I load the controls into them, while maintaining the ability to use standard functionality that allows you to load controls into the control of active elements.

for example, I want the input control to be loaded into the Login ContentControl, and when the user has successfully registered, I want the new control to load into the ActiveItem ContentControl.

Thanx in advance.

+6
source share
2 answers

If the ViewModel bound to the user interface contains a property with a name that matches the content control. The content control automatically gets the allowed view supported by this property if this property is a ViewModel type and registered in the Ioc container. For instance,

<ContentControl x:Name="LoginStatus"></ContentControl> 

If the main ViewModel has the LoginStatus property (the LoginStatus property itself is ViewModel). Content management will be displayed correctly with the appropriate view.

+6
source

You should take a look at the screen conductors. See here .

0
source

Source: https://habr.com/ru/post/889432/


All Articles