Search code examples
windows-phone-7mvvmpanorama-control

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.


Solution

  • 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