I’m having massive issues with the WPF ribbon. Here’s a bit of Ribbon code. (I’m using System.Windows.Controls.Ribbon), all of this inside a RibbonWindow on .NET 4.5/VS2012.
<Ribbon VerticalAlignment="Top" Height="Auto" HorizontalAlignment="Stretch">
<RibbonTab Header="Home" Height="Auto" VerticalAlignment="Top">
<RibbonGroup Header="Save/Load" Height="Auto" Margin="0"
VerticalAlignment="Top" Width="Auto">
<Grid HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button x:Name="cmdLoadImage" Click="cmdLoadImage_Click"
Margin="10,10,10,10" Grid.Column="0">
<Image Source="Images\load-icon.png" />
</Button>
</RibbonGroup>
</RibbonTab>
</Ribbon>
Point 1-2 are bugs.
- I can’t change the height of the
Ribbon, despite changing theVerticalAlignmentproperties of theRibbonTabandRibbonGrouptoStretch. The visual height remains the same. - Changing the
Buttonto aRibbonButtonvanishes the image inside it, while keeping it atButtonhas visual repercussions. - How do I make the
Ribbonspan the window as in MS Office? TheApplicationMenugoing to the top, and so on?
Edit: A free, alternate ribbon control library for WPF will be appreciated. I want to use it commercially.
For the first question: sorry to disappoint you Microsoft Ribbon have fixed height so you cant change it.
As for the second question: you should use
LargeImageSourceandSmallImageSourceinstead of put the image intoRibboButton.Your third question is not obvious enough, But if you mean that you want to join the
ApplicationMenuto window title this is the answer: you have to change your window type toRibbonWindow:and in window code behind:
your design have some mistakes lets fix it.
first of all you have to put the ribbon in grid:
Note: you have to set
LargeImageSourceproperty To appear theRibbonButtoncorrectly.Good luck.