Yakumo Fujii
Yakumo Fujii

Reputation: 97

PRISM WPF MVVM : Binding region content to viewmodel property of injected view

I have several regions in which I inject a custom view for each region. Every view has the same base class and the same base view model.

What I want is that when I change the view model property, lets say, visibility, this affects the visibility of the contentcontrol that has the region name that the view is injected into.

Is there a way of doing so via bindings?

Thanks in advance.

Upvotes: 0

Views: 783

Answers (1)

Haukinger
Haukinger

Reputation: 10863

You can put your regions in a "parent view" with its own view model. Then you inject your views as before, but put the properties binding to the visibility of each region in the "parent view model".

Besides that, the RegionManager provides navigation functionality to exchange the content of regions.

Upvotes: 1

Related Questions