In Microsoft office the applications have a "help" button and a "minimize ribbon" button, just bellow the (minimize, restore, close) button bar.
I have been looking on how to add buttons there in the XamRibbon, but i just can't find it. I need to add a button for help and one for feedback.
I am new using the Infragistics ribbon, so i was checking this page http://ko.infragistics.com/products/wpf/sample/ribbon/application-menu, but I could not find what I needed.
Any help will be appreciated! Thank you!
Hello Vivana,
I have been looking into your question and currently we do not provide a built-in functionality for help(question) icon. I am attaching you a sample application(RibbonQuestionIcon(Help).zip) where I have added such kind of icon to the XamRibbon.
Let me know, if you need any further assistance on this matter.
Yanko, thanks for your prompt answer.
I must say I am disapointed that infragistics doesn't have this functionality. I find it is sort of common and expected since most Microsoft apps have them. At least my users expect those buttons to be there :P
I am checking into your code, and as I said I am new using Infragitics for WPF, and in WPF itself. But I am intrigued on why so much code it is required to achieve this. Isn't there a more simple way to add those buttons? It seems a bit of an overkill.
I will appreciate any comment! Thank you!
Hi Yanko! Thansk again for your answer.
I have been trying to implement what you suggested, but I am encountering many issues. Maybe you can help me out.
<igRibbon:XamRibbonWindow x:Class="RibbonWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:igRibbon="http://infragistics.com/Ribbon" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:igWPF="http://schemas.infragistics.com/xaml/wpf" mc:Ignorable="d" d:DesignHeight="600" d:DesignWidth="800" WindowState="Maximized">
<igRibbon:XamRibbonWindow.Resources>
//I added your code here
//There is some data templates
</igRibbon:XamRibbonWindow.Resources>
<igRibbon:RibbonWindowContentHost x:Name="ribbonWindowContentHost" > <igRibbon:RibbonWindowContentHost.Ribbon> <igRibbon:XamRibbon x:Name="xamRibbon" Theme="[current]"> <igRibbon:XamRibbon.ApplicationMenu> <igRibbon:ApplicationMenu> <igRibbon:ApplicationMenu.FooterToolbar> <igRibbon:ApplicationMenuFooterToolbar> <igRibbon:ButtonTool Name="appMenuOptions" Caption="Opt_ions"/> </igRibbon:ApplicationMenuFooterToolbar> </igRibbon:ApplicationMenu.FooterToolbar> </igRibbon:ApplicationMenu> </igRibbon:XamRibbon.ApplicationMenu>
</igRibbon:XamRibbon> </igRibbon:RibbonWindowContentHost.Ribbon> <ContentControl Content="{Binding MyContent}" ContentTemplateSelector="{StaticResource myContentTemplateSelector}" /> </igRibbon:RibbonWindowContentHost> </igRibbon:XamRibbonWindow>
The xaml where i have the Ribbon is like this. Then we add in the code behind the tabs (Ribbon.Tabs.Add(tab);) So we tried to add the code you sent me in the Resources secion of the Ribbon. But when we run the application it gets completly ignored.
Any suggestions you could make me will be greatly appreciated.
Thank you!
Hi Viviana,
Thank you for your feedback. You need to add my code in the resources of the XamRibbon instead of the XamRibbonWindow
<igRibbon:XamRibbon x:Name="xamRibbon" Theme="[current]">
<igRibbon:XamRibbon.Resources>
…..
</gRibbon:XamRibbon.Resources>
When you pointed that out, I realized my mistake. Thank you!
You have been extremely helpful. But we are still encountering a problem.
Next to the help button we need a minimize ribbon. We have been looking around how to implement this. But we will appreciate any suggestions you can give us.
Thanks in advance!
Hi,
You can add another button in the stack panel, just right above the HelpIcon button(above in xaml code). And set the minimizing ribbon's command to it:
<Button Background="Transparent" BorderBrush="Transparent" Command="igRibbon:RibbonCommands.ToggleRibbonMinimizedState"> <Image Source="help_icon.gif" Width="16" Height="16"/> </Button>
Hope this is helpful for you.
Anastas
Thanks Anastas for your answer!
If I understand correctly I have to add a button like the one you describe before the help one.
I assume that the Source="help_icon.gif" you put it is just a mistake no?
I tested this command and it minimizes the ribbon as you indicated. But how would you implement the image? I mean the minizing ribbon button changes image according to its state (if it minimized or not).
Thanks for your comments!
We are actually using it like this:
xmlns:igRibbon="http://infragistics.com/Ribbon"<igRibbon:XamRibbon x:Name="xamRibbon" Theme="[current]" ApplicationMenuMode="Office2010">
It was a bit of a struggle to make it work, but we are not experiencing the error you mention. Maybe you can add a screenshot?
Check selecting different themes, it could be related to that.
Has this solution been used when the ApplicationMenuMode="Office2010" for the Ribbon? When we try it the spacing between the tabs is wrong and the tabs seem to overlap eachother a little. We have not found a way to change this solution to work with the 2010 application menu. We are trying to look through the RibbonGeneric.xaml but if there is a simplier solution please let us know.
Thanks
-eric
Hello Viviana,
Thank you for your for your feedback.
Under each post you would find the "Verify Answer" button, which you could choose for any of the post that you find to be helpful for you.
If you have any other questions please do not hesitate to contact us.
Hi Anastas, that worked great. Can I makr several answers as the answer of the post?
Because several of the post were useful for me on fixing the issue.
Thanks!
Hi again,
I'm attaching a sample project with helpicon and minimized button set. But this time minimize button rotates itself when ribbon's minimized state is changed. Basically, I added the stack panel with both buttons inside ControlTemplate for XamTabControl, and a trigger which rotates the minimize button when ribbon is in minimized state.
Hope this helps you.