This is a migrated thread and some comments may be shown as answers.

MEF and PRISM module Button loading

2 Answers 112 Views
RibbonView and RibbonWindow
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 02 May 2013, 05:27 PM

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:RadRibbonGroup.Variants>
                            <telerik:GroupVariant Priority="2" Variant="Large"/>
                        </telerik:RadRibbonGroup.Variants>
                        <telerik:RadOrderedWrapPanel>
                            <telerik:RadRibbonButton LargeImage="/Icons/48/Search.png" Size="Large" telerik:ScreenTip.Title="Order Search"/>
                        </telerik:RadOrderedWrapPanel>
                    </telerik:RadRibbonGroup>

2 Answers, 1 is accepted

Sort by
0
Kiril Vandov
Telerik team
answered on 07 May 2013, 02:45 PM
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.

0
Jonathan
Top achievements
Rank 1
answered on 07 May 2013, 02:51 PM
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.

 

ViewSortHint("200")

Thanks
Jon

Tags
RibbonView and RibbonWindow
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Kiril Vandov
Telerik team
Jonathan
Top achievements
Rank 1
Share this question
or