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

RibbonView & PRISM - Some Tabs not showing

2 Answers 157 Views
RibbonView and RibbonWindow
This is a migrated thread and some comments may be shown as answers.
Hans
Top achievements
Rank 1
Hans asked on 26 May 2014, 05:52 PM
Hi!

At the moment, I'm writing an application using the RadRibbonWindow, a RadRibbonView and PRISM. Today I encountered a problem and I'm not sure if this is a bug or me doing something the wrong way.

The application consists of these main parts:
-The shell (A RadRibbonWindow)
-A RadRibbonView hosted inside the Window (it has the RegionManager.RegionName set to "RibbonView")
-Multiple modules each containing RadRibbonTabs (some have the ContextualGroupName where needed
-Each module is added to the region using the [ViewExport(RegionName="RibbonView")] attribute and the AutoPopulateExportedViewsBehavior
-Implicit Styles are used (Office 2013)

Now the strange part:
Only RibbonTabs having the ContextualGroupName set are visible in the RibbonView (as expected), but injected tabs having this attribute not set are not visible (I expected them to show up permanent)

Remarks:
Somewhere in this forum I read that an additional RegionAdapter is not needed in my case, because each injected usercontrol derives directly from RadRibbonTab. I think Tina mentioned this in one of her posts. Some tabs show up so I guess this is right, isn't it?
Nevertheless I experimented with RegionAdapters but had no success.

I would appreciate any help or hint getting my problem solved :) Many thanks in advance!

btw.: I'm already using Q1 2014

2 Answers, 1 is accepted

Sort by
0
Accepted
Kiril Vandov
Telerik team
answered on 27 May 2014, 08:18 AM
Hello Hans,

The Implicit Style can not be applied to derived controls as their TargetType is different than the one defined in the Implicit Style. If you set the style implicitly, the style is applied only to the types that match the TargetType exactly and not to elements derived from the TargetType value. You can find more information on the topic in the remarks of the Style property definition.

This is why in order to apply a Telerik predefined style on a UserControl deriving from RadRibbonTab, you  need to add a Style targeting the UserControl type in the Resources of the application. It is best to define that style after merging the Telerik ResourseDictionaries so that you can base the UserControl Style on the predefined "RadRibbonTabStyle".
Another approach is to add the style directly to the modules of your RadRibbonTabs, like follows:
<telerik:RadRibbonTab x:Class="TestApplication.RibbonTab1"
      Style="{StaticResource RadRibbonTabStyle}"
...

I hope this information helps.

Regards,
Kiril Vandov
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.
 
0
Hans
Top achievements
Rank 1
answered on 27 May 2014, 09:29 AM
Ahhh, ok. That was exactly my problem. Now everything is working as expected. Simply setting the Style in the modules did the trick. Thank you so much!!!
Tags
RibbonView and RibbonWindow
Asked by
Hans
Top achievements
Rank 1
Answers by
Kiril Vandov
Telerik team
Hans
Top achievements
Rank 1
Share this question
or