user5535613
user5535613

Reputation:

Changing User Control When Another Button in a User Control is Clicked

This answer can be in either Prism and/or Caliburn.Micro. Changing user control in the main shell can be done with something like this:

Prism

_regionManager.RequestNavigate("ContentRegion", uri);

Caliburn.Micro

ActivateItem(new ViewModel());

But my question is, how can you change the user control that is shown in the shellview upon clicking a button inside another user control?

Upvotes: 0

Views: 120

Answers (1)

Haukinger
Haukinger

Reputation: 10863

You can use the exact same line (for Prism, at least) in any command anywhere. In case your're wondering how to get the _regionManager - just have it injected as constructor dependency.

Upvotes: 1

Related Questions