What is the ideal way to design a very large Infragistics ribbon?
Is it possible to satisfy all three requirements?
If I use a resource dictionary for the tabs, I think I get #1.
If I put it all in one file, I think I get #2 & #3.
If I write a class and do something like the XAML below, I get #1 and #2.
<igRibbon:RibbonTabItem x:Class="XYZ.Views.HomeTab"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:igRibbon="http://infragistics.com/Ribbon"
mc:Ignorable="d">
<igRibbon:RibbonGroup>
<igRibbon:ButtonTool Caption="xyz" LargeImage="{StaticResource xyz}"/>
</igRibbon:RibbonGroup>
</igRibbon:RibbonTabItem>
Hello Wayne,
How much do you want to split the ribbon up? A XamRibbon can have n number of tabs and each tab can have n number groups which in turn can contain n number of controls. Depending on your requirements it can get quite complicated trying to split things up. At the simplest, you would only be interested in splitting each tab into it's own file which you can do using the method you already showed at the bottom of your post. Essentially you derive your own class from RibbonTabItem which will go into it's own XAML and CS files. Inside the XAML you define how the tab would appear and then in your Ribbon you can add instances of these derived classes to the Tabs collection.
I'm no expert in Blend but I don't see why this approach wouldn't allow you to use it. While blend won't be able to render each individual derived RibbonTabItem, you will be able to use it to add RibbonGroups and controls to the tab and modify their properties. Once you add them to the ribbon though, they will be rendered.
Rob writes:
"While blend won't be able to render each individual derived RibbonTabItem"
I'd really like to be able to see the tab while I work on it. Why doesn't RibbonTabItem render in the viewer of VS/Blend?
Let me know if you have any further questions on this matter.
The XamRibbon is very similar to a TabControl. The Content for a TabItem is rendered by the TabControl itself through a ContentPresenter called PART_SelectedContentHost. If you were to define a custom TabItem in Blend you would see the same behavior. In order for the TabItem to show up in the designer it would need to render it's own content which it does not do.
The "trick" you need to use is to create a dummy XamRibbon somewhere and load up your derived RibbonTabItem into it. If you would like for the tab's content to be rendered at design time then I recommend that you submit a new product idea at our product idea website. http://ideas.infragistics.com
There are many benefits to submitting an product idea:
- Direct communication with our product management team regarding your product idea.
- Notifications whenever new information regarding your idea becomes available.
- Ability to vote on your favorite product ideas to let us know which ones are the most important to you. You will have ten votes for this and can change which ideas you are voting for at any time.
- Allow you to shape the future of our products by requesting new controls and products altogether.
- You and other developers can discuss existing product ideas with members of our Product Management team.
Steps to create your idea:
1. Log into the Infragistics Product Idea site at http://ideas.infragistics.com (creating a new login if needed).
2. Navigate to the product / platform channel of your choice (e.g. WPF, Windows Forms, ASP.NET, HTML5 / Ignite UI, iOS / NucliOS, etc.)
3. Add your product idea and be sure to be specific and provide as much detail as possible. Explain the context in which a feature would be used, why it is needed, why it can’t be accomplished today, and who would benefit from it. You can even add screenshots to build a stronger case. Remember that for your suggestion to be successful, you need other members of the community to vote for it. Be convincing!
The Product Idea site puts you in the driver’s seat and allows you to track the progress of your ideas at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.
"the tab is rendered but all you will see is the tab header"
Why not design the tab so that it does not require a host XamRibbon to render it at Design time?
Is it possible to "trick" the component at design time to think it is hosted (using some design time attribute)?
Hi Wayne,
I should make a correction, the tab is rendered but all you will see is the tab header. This is because the RibbonGroups and tools are not actually part of the RibbonTabItem's Visual Tree. It isn't until the tab is placed inside a XamRibbon that the ribbon tools are rendered. You would see this same behavior in the Visual Studio designer.
When you are working on the tab, you will need to place it inside a ribbon (you can create a dummy ribbon on a dummy page for this). Once inside the ribbon you will see all the components.