I have described my problems with binding the SelectedItem of the RibbonComboBox. Another very ugly issue arises when trying to style this control.
Starting with the unstyled ComboBox from the post mentioned above:
<r:RibbonComboBox >
<r:RibbonGallery SelectedItem="{Binding SelectedItem, Mode=TwoWay}">
<r:RibbonGalleryCategory ItemsSource="{Binding Controls}" DisplayMemberPath="Caption" />
</r:RibbonGallery>
</r:RibbonComboBox>
I get the expected result:
But when applying a style with the help of Microsoft Blend (Preview for VS 2012), Object | Edit Style | Edit a Copy... (copying only the Template, with Blend or Visual Studio, has the same effect):
The selected item will no longer be displayed correctly - instead of the DisplayMemberPath property, the type name is shown. Items in the dropdown are still correct. Note that I did not yet change the style in any way, it is the default style/template that gets extracted that will produce this issue.
<r:RibbonComboBox Style="{DynamicResource RibbonComboBoxStyle1}" >
I also had trouble to style my dropdown items (mainly wanted to change the mouseover background cornerradius), because the ItemContainerStyle for the RibbonComboBox will have target type RibbonMenuItem and does not seem to have an effect on the actual RibbonGalleryItems.
- How to fix the RibbonComboBox style?
- How can I get to the RibbonGalleryItem style by way of Blend/VS?