MEF and PRISM module Button loading

3 posts, 0 answers
  1. Jonathan
    Jonathan avatar
    2 posts
    Member since:
    May 2013

    Posted 02 May 2013 Link to this post

    I have managed to set up a PRISM region within the radRibbonView.RadRibbonTab which then has radRibbonGroup's loaded in from the modules containing the buttons for that module.  All good so far, however the modules donot load in the order which the radribbongroups need to appear in the tab.

    I have tried using the radOrderedwrappanel in conjunction with the groupvariant priority as per snippit below to provide a solution with no luck.  Is there a way of doing this or will I have to look into custom loading order of the modules?

    I ahve also added a custom regionAdaptor which seems to be working fine to allow the radribbongroups to be loaded into the orderedwrappanel.  However the ordering and sizing didnt work - it started wrapping after 3 ribbonGroups and it didnt order the groups correctly.

    <telerik:RadRibbonGroup Header=" Order Search ">
                                <telerik:GroupVariant Priority="2" Variant="Large"/>
                                <telerik:RadRibbonButton LargeImage="/Icons/48/Search.png" Size="Large" telerik:ScreenTip.Title="Order Search"/>
  2. Kiril Vandov
    Kiril Vandov avatar
    324 posts

    Posted 07 May 2013 Link to this post

    Hello Jonathan,

    In PRISM the order of the modules you add in the override of the CreateModuleCatalog() method may not be the order in which the modules are loaded. The ModuleCatalog.AddModule() methods are executed asynchronously and in some cases one of the modules can delay its loading. This could be the reason why your groups are not loaded in the order your are expecting. However in the AddModule() method you could set the DependsOn property of the ModuleInfo class and explicitly set after which module, the module you add to be loaded.

    I hope this information helps. Please let us know if this works for you. If this is not working for you please provide us with more detailed information for your scenario or if you can, please attach a sample project reproducing this issue.

    Kind regards,
    Kiril Vandov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Jonathan
    Jonathan avatar
    2 posts
    Member since:
    May 2013

    Posted 07 May 2013 Link to this post

    Hi Kiril,

    We had already looked at that as a solution but didnt want to make the modules rely on each other as in some cases they will only be loaded on demand.

    However we have found another solution in the PRISM 4.0 framework using the ViewSortHint attribute on the views which then re-orders them based on the value in the parenthsis ("200").  Is now working as required.




Back to Top