general prism/MVVM question

9 posts, 0 answers
  1. Michael
    Michael avatar
    105 posts
    Member since:
    Nov 2010

    Posted 26 Dec 2010 Link to this post

    I am struggling on what event to subscribe to and how to design a project based around the outlook bar and prism.

    So far I have the main shell with 2 regions: One which holds the OutlookBar  and ...

    the Main Region

    I have modules which include Views for the outlookbar; The view is a RadOutlookBarItem
    and views for the main region.

    The Outlook Views all load correctly, but I am at a loss as to how to "wireup" these such that when the outlookbar items are selected the appropriate view is displayed in the Main Region.

    I'm guessing the ViewModel for the main program should do something like (from the samples)

    RadOutlookBarItem newSelectedItem = (sender as RadOutlookBar).SelectedItem as RadOutlookBarItem;

    then call something on this which is translated back within the OutlookBarItems View Model??

    like newSelecteditem.IsSelected = true; ???

    Then I'm not really sure of the code to display that view (which was previously registered with the "MainRegion"?)

    any help either links or gentle pushes greatly appreciated

    TIA
    Michael

  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 29 Dec 2010 Link to this post

    Hello Michael,

    If I understand your scenario correctly, you need to implement a master/detail scenario using PRISM. If this is indeed the case, you can check this article illustrating a possible solution. I hope it will help you.

    Let us know how it goes.

    Kind regards,
    Tina Stancheva
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for WPF
  3. UI for WPF is Visual Studio 2017 Ready
  4. Michael
    Michael avatar
    105 posts
    Member since:
    Nov 2010

    Posted 08 Feb 2011 Link to this post

    Sorry this reply has taken so long in getting back, but no that doesn't reflect my scenario.

    I have multiple modules which each register a RadOutlookBarItem in the outlook bar "region". Each module also contains a view for the "mainregion" which should be displayed as that module's outlookbaritem is selected. (Within the outlookbaritem I might then have a parent child relationship or filter the results some way, but of the modules "main" view.

    I figure it must all be tied up with the outlookbar selectionchanged event, although I've also read about the INavigationAware interface and perhaps the viewmodel for each outlookbaritem should implement this and trigger the mainview once the "outlookBarItem" view is navigated to?

    In my preliminary dabbling with this I have run into the problem of trying to add multiple instances of views to a region (the region is a radpane and i think i've also read about the navigation behaving differently for single view components and multi view?)


  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 11 Feb 2011 Link to this post

    Hello Michael,

    Please accept my apology for the delayed response. I prepared a sample project that illustrates a possible approach towards your scenario. I data bound the IsSelected property of the RadOutlookBarItem and used it to activate the MainRegion views. I hope it will help you get started on your task.

    Please have a look at the project and let me know if it works for you or if you need more info.

    Kind regards,
    Tina Stancheva
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  6. Brew Hutch
    Brew Hutch avatar
    56 posts
    Member since:
    Apr 2010

    Posted 12 Jun 2014 Link to this post

    Hi Tina,
    I use your sample and It works fine with Telerik dlls 2011.1.0419.40, but when I upgrade dlls to 2013.3.1016, the rad menu is collapsed at start up. Would you please advise what's missing? 

    Thanks,
    Brew
  7. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 17 Jun 2014 Link to this post

    Hello,

    I am not sure why your application crashes but it seems that the RadOutlokBarItems are not populated. I created a project using our latest official release and PRISM 4.1 to build it and it seems that the code works as expected.
    Please take a look at the attached application and let me know if it works for you. Please note that the ActiveItemsCount property of the RadOutlookBar control is set.

    Regards,
    Pavel R. Pavlov
    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.
     
  8. Brew Hutch
    Brew Hutch avatar
    56 posts
    Member since:
    Apr 2010

    Posted 17 Jun 2014 in reply to Pavel R. Pavlov Link to this post

    ActiveItemsCount  does a trick. If I set it to 99 for example, would it cause any problem?
  9. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 20 Jun 2014 Link to this post

    Hello,

    This property controls the maximum number of items that can be visualized under the horizontal splitter. If you set it to 99 the RadOutlookBar will try to fit 99 items there and the items will be moved to the Minimized area if their count exceed 99. This will force the control to reduce (or completely remove) the area of the SelectedContent with every item added. The usual setting of this property is up to 10.

    I hope this information will help you decide if you actually need to set the ActiveItemsCount  property to such big number of items. 

    Regards,
    Pavel R. Pavlov
    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.
     
  10. Brew Hutch
    Brew Hutch avatar
    56 posts
    Member since:
    Apr 2010

    Posted 20 Jun 2014 in reply to Pavel R. Pavlov Link to this post

    Thank you Pavel for info.
Back to Top
UI for WPF is Visual Studio 2017 Ready