user969153
user969153

Reputation: 576

Bind various panaroma/pivot items using MVVM

could someone help me with design/understanding the problem: what I need to achieve is page with Panorama/Pivot control, where its items (panos/pivots) will be set via binding, using standard MVVM pattern. Problem is I need to have different content (different user controls) on each pano/pivot, that means If I define a panorama/pivot item template, I doom all of them to be alike, which is not what I want.

I found this question here already asked: Databound windows phone panorama with MVVM design but its still not clear to me. Many thanks.

Upvotes: 0

Views: 1227

Answers (2)

Marius Bughiu
Marius Bughiu

Reputation: 1017

You could add a dependency property to the user control that you want to use as a data template, a dependency property named "Type" for example and depending on that property you can change the layout of your user control (data template) - for example you could have multiple grids inside your user control and you could show and hide them depending on the type.

Upvotes: 1

Ku6opr
Ku6opr

Reputation: 8126

If you have a dynamic page count on panorama/pivot you could use selector to choose what template is right according to your content.

Implementing DataTemplateSelector

Also, Data Binding Pivot to MVVM may help you too

Upvotes: 2

Related Questions