我正在尝试将文本放在RibbonApplicationMenu的顶层(尝试获取类似于Word或Outlook的"文件"一词).似乎Microsoft.Windows.Controls.Ribbon.RibbonApplicationMenu
http://msdn.microsoft.com/en-us/library/microsoft.windows.controls.ribbon.ribbonapplicationmenu.aspx支持SmallImageSource但没有文本属性.设置该Label
属性不适用于此问题.
xmlns:ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
<ribbon:RibbonApplicationMenu Label="File"> <!--doesn't set the label -->
</ribbon:RibbonApplicationMenu>
Run Code Online (Sandbox Code Playgroud)
目标是在下面的圆圈区域中显示"文件"一词.
我试图从.NET Framework 4.5 更改新的WPF功能区控件的主题,我被卡住了.
我只设法改变了一些画笔(背景,前景,边框...),但我似乎无法改变明亮的叠加和阴影.
我很高兴使用资源字典,但我不知道我需要设置哪些属性.
我希望你能指出我正确的方向,非常感谢你的帮助!
现在Windows 7就在这里,功能区控件似乎风靡一时.
我在这个链接上发现了Codeplex上的功能区控件...
我想知道的是,将UI范例转变为纯粹"与时俱进或与发展趋势保持同步"是否有任何实际好处?
我只是看不出这样做的重点,除非您正在处理的应用程序超过了Microsoft的Word,因为它有一堆菜单选项.
使用功能区控件,必然会有一些终端用户喋喋不休地尖叫着想要他们的旧UI回来......
我在Outlook中有一个自定义按钮,我必须为同一个按钮添加图像图标.
功能区XML是:
<button id="GoToAppConfiguration"
label="Application Configuration"
getImage="GetCustomImage"
onAction="GoToAppConfigurationClicked"
size="normal" />
Run Code Online (Sandbox Code Playgroud)
我想编写功能区回调方法但是如何编写相同的内容以及如何使用存储在Addin项目下的Resource文件夹中的图像.
我正在使用WPF工具包中的RibbonControl.它有Office Blue,Black和Silver主题.但主题不适用于窗口中的控件.那有什么解决方案吗?
我正在接受这样的主题
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/RibbonControlsLibrary;component/Themes/Office2007Black.xaml"/>
</ResourceDictionary.MergedDictionaries>
Run Code Online (Sandbox Code Playgroud)
但是控件就像按钮一样,文本框也没有变化.
使用ribboncontrolslibrary,当我运行我的应用程序时,标题栏看起来像W98应用程序.我该如何让它看起来漂亮?
编辑:似乎与Windows上使用的主题有关.
任何帮助,将不胜感激.
alt text http://img718.imageshack.us/img718/8188/321321.jpg
<r:RibbonWindow x:Class="Produccion_Dampers.main"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:r="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
Title="Window1"
Height="600"
Width="800">
<DockPanel>
<r:Ribbon DockPanel.Dock="Top" Title="my App looks like s***t">
</r:Ribbon>
</DockPanel>
</r:RibbonWindow>
Run Code Online (Sandbox Code Playgroud) 我已经安装了VS 2008.当我尝试构建项目时,我收到一条错误消息:
无法打开包含文件:'afxcontrolbars.h':没有这样的文件或目录
所以,我想我需要为此安装功能区控件.你能告诉我哪些SDK可供下载吗?链接会非常有用; 我自己用Google搜索,但我找不到它.:(
我找到了这个:
<DataTrigger Value="True" Binding="{Binding (0)}">
Run Code Online (Sandbox Code Playgroud)
RibbonMenuButton
模板中的触发器.这是什么意思?我试过谷歌,但一无所获.
UPD更多代码:
<ControlTemplate x:Key="RibbonMenuButtonControlTemplate1" TargetType="{x:Type RibbonMenuButton}">
...
<DataTrigger Binding="{Binding (0)}" Value="True">
<Setter Property="TextElement.Foreground" TargetName="MainGrid" Value="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}"/>
<Setter Property="PathFill" TargetName="TwoLineText" Value="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}"/>
<Setter Property="CornerRadius" TargetName="OuterBorder" Value="0"/>
<Setter Property="Background" TargetName="OuterBorder" Value="Transparent"/>
<Setter Property="BorderBrush" TargetName="OuterBorder" Value="Transparent"/>
</DataTrigger>
...
Run Code Online (Sandbox Code Playgroud)
在RibbonMenuButton
控件上按下"编辑模板"按钮后,在Blend中创建此代码.
wpf datatrigger controltemplate expression-blend ribbon-control
我有一个RibbonComboBox
用于设置字体大小.它有一个RibbonGallery
列出各种字体大小,显示在适当的FontSize
:
<r:RibbonComboBox DataContext="{x:Static vm:RibbonDataModel.FontSizeComboBoxData}"
SelectionBoxWidth="30">
<r:RibbonGallery MaxColumnCount="1"
Command="{Binding Command}"
CommandParameter="{Binding SelectedItem}">
<r:RibbonGallery.GalleryItemTemplate>
<DataTemplate>
<Grid>
<TextBlock Text="{Binding}"
FontSize="{Binding}" />
</Grid>
</DataTemplate>
</r:RibbonGallery.GalleryItemTemplate>
</r:RibbonGallery>
</r:RibbonComboBox>
Run Code Online (Sandbox Code Playgroud)
编辑这是我的ViewModel:
public static RibbonDataModel
{
public static GalleryData<object> FontSizeComboBoxData
{
get
{
lock (LockObject)
{
const string key = "Font Size";
if (!DataCollection.ContainsKey(key))
{
var value = new GalleryData<object>
{
Command = HtmlDocumentCommands.ChangeFontSize,
Label = "Change Font Size",
ToolTipDescription = "Set the font to a specific size.",
ToolTipTitle = "Change …
Run Code Online (Sandbox Code Playgroud) wpf ribbon ribbon-control windows-ribbon-framework ribboncontrolslibrary
ribbon-control ×10
wpf ×6
c# ×4
ribbon ×2
add-in ×1
datatrigger ×1
mfc ×1
outlook ×1
qt ×1
visual-c++ ×1
windows ×1
wpf-4.5 ×1
wpftoolkit ×1