如何风格RibbonComboBox [英] How to style RibbonComboBox

查看:479
本文介绍了如何风格RibbonComboBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已描述了反编译器。



功能之一是:


...反编译.baml文件,您可以重建XAML UI定义。


此外,我刚刚完成编辑视觉RibbonCombobox及其相关控件使用上述反编译器,反编译整个功能库库包括原始的Microsoft .XAML主题。


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.

  1. How to fix the RibbonComboBox style?
  2. How can I get to the RibbonGalleryItem style by way of Blend/VS?

解决方案

You may want to take a look at JetBrains dotPeek decompiler.

One of its features is:

"... decompile .baml files, enabling you to reconstruct XAML UI definitions."

In addition, I just finished to edit visual RibbonCombobox and its relative controls by using the decompiler mentioned above, which decompiled the entire Ribbon library including original Microsoft .XAML themes.

这篇关于如何风格RibbonComboBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆