PanelBar and MVVM

3 posts, 0 answers
  1. Doug
    Doug avatar
    13 posts
    Member since:
    Apr 2014

    Posted 12 May 2014 Link to this post

    Hello everyone.

    I am playing around with MVVM (leveraging Prism and Unity), but I am somewhat stuck on how to bind my modules to a PanelBar properly. What I want to do is set the ItemHeader text to the name of whatever module I am loading (at design time, I don't know how many modules will be loaded), and then have the Items (Views) be displayed under that.  Graphically it would look something like this:

    ################    PanelBar    ############### 
    ================Module 1 Text=============== //ItemHeader
    ---------------------------- View     1 Text--------------------------- //Item
    ---------------------------- View     2 Text--------------------------- //Item
    ---------------------------- View     3 Text--------------------------- //Item
    ================Module 3 Text=============== //ItemHeader
    ---------------------------- View     1 Text--------------------------- //Item
    ---------------------------- View     2 Text--------------------------- //Item
    ########################################## 

    I know (basically) how to get 'View X Text' to display through the use of a ViewModel, but I am not sure about getting the ItemHeader set properly.  Any help that you can provide would be greatly appreciated!

    Thanks.

  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 15 May 2014 Link to this post

    Hi Doug,

    I prepared a sample project for you in which the names of the Prism Modules are set to be Headers of the root level PanelBarItems. I hope this is what you need to achieve or at least you can get some ideas from this project. 

    Regards,
    Petar Mladenov
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Doug
    Doug avatar
    13 posts
    Member since:
    Apr 2014

    Posted 16 May 2014 Link to this post

    Petar,

    This is exactly what I was looking for.  Thanks!

    -Doug
Back to Top