WPF:RibbonControlLibrary 的自定义主题
我正在使用 Microsoft 的 RibbonControlLibrary。它具有三个预定义主题,可以通过“
<ResourceDictionary Source="/RibbonControlsLibrary;component/Themes/Office2007Black.xaml"/>
or
<ResourceDictionary Source="/RibbonControlsLibrary;component/Themes/Office2007Blue.xaml"/>
or
<ResourceDictionary Source="/RibbonControlsLibrary;component/Themes/Office2007Silver.xaml"/>
我如何为此功能区定义自己的自定义主题?” 来使用它们。有可用的自定义主题吗?
I am using RibbonControlLibrary by Microsoft. It has three predefined themes and one can use them by
<ResourceDictionary Source="/RibbonControlsLibrary;component/Themes/Office2007Black.xaml"/>
or
<ResourceDictionary Source="/RibbonControlsLibrary;component/Themes/Office2007Blue.xaml"/>
or
<ResourceDictionary Source="/RibbonControlsLibrary;component/Themes/Office2007Silver.xaml"/>
How can i define my own custom theme for this Ribbon? Is there any custom theme available?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在此处快速下载功能区控件库的源代码 http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=2bfc3187-74aa-4154-a670-76ef8bc2a0b4
You can quickly download the source codes of the Ribbon Control Library here http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=2bfc3187-74aa-4154-a670-76ef8bc2a0b4
当我使用 Reflector 检查 RibbonCntrolsLibrary.dll 时,我在资源中看到了 RibbonControl 的主题文件,但这些是 .baml 文件。所以在这里我找到了一个 baml 到 xaml 转换器: BamlViewer。
我下载了这个 dll 文件并将其添加到我的反射器中,现在我可以将 .baml 文件的内容转换为 xaml。在这里您可以获得 RibbonControl 的预定义主题,现在使用它您可以轻松定义自己的主题并将其分配给 RibbonControl(不要忘记使用与默认主题中相同的样式键)。
While I checked the RibbonCntrolsLibrary.dll with reflector, I saw the themes files for RibbonControl in the resources but these were .baml files. So here I found a baml to xaml converter: BamlViewer.
I downloaded this dll file and added it into my reflector, now I am able to convert the content of .baml file into xaml. Here you get the pre-defined theme for RibbonControl, Now using this you can easily define your own theme and assign it to RibbonControl(don't forget to use the same keys for styles as in the default theme).