RibbonApplicationMenu - Label 设置不启作用
来源:互联网 发布:游戏制作软件大全 编辑:程序博客网 时间:2024/05/17 06:57
问题:I am using the WPF ribbon from October 2010, I would like to have the word "File" as the ApplicationMenu "label" similar to excel 2010. I set the Label property but it does not seem to do anything. I see there is a smallImageSource property but I jsut want to put text.
答案:Regarding to the first question, I checked the source code of the Ribbon controls (please download theMicrosoftRibbonForWPFSourceAndSamples from web site). In the theme file (\MicrosoftRibbonForWPFSourceAndSamples\RibbonControlsLibrary\Themes\Generic.xaml) of the ribbon
8072行附近, change the code:
<!--<Image IsHitTestVisible="False" Source="{Binding RelativeSource ={RelativeSource FindAncestor, AncestorType ={x:Type ribbon:RibbonApplicationMenu}}, Path=SmallImageSource}" HorizontalAlignment="Center" VerticalAlignment="Center" Width="16" Height="16" RenderOptions.BitmapScalingMode="NearestNeighbor" RenderOptions.EdgeMode="Aliased" />--> <TextBlock Text="{TemplateBinding Label}"/>
8233行附近 change the code: 最后一行添加Label={TemplateBinding Label}
<ControlTemplate TargetType="{x:Type ribbon:RibbonApplicationMenu}"> <Grid Focusable="False" x:Name="OuterGrid" SnapsToDevicePixels="True"> <ribbon:RibbonToggleButton x:Name="PART_ToggleButton" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" Style="{StaticResource Ü}" FocusVisualStyle="{TemplateBinding FocusVisualStyle}" Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Height}" Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Width}" ToolTipTitle="{TemplateBinding ToolTipTitle}" ToolTipDescription="{TemplateBinding ToolTipDescription}" ToolTipImageSource="{TemplateBinding ToolTipImageSource}" ToolTipFooterTitle="{TemplateBinding ToolTipFooterTitle}" ToolTipFooterDescription="{TemplateBinding ToolTipFooterDescription}" ToolTipFooterImageSource="{TemplateBinding ToolTipFooterImageSource}" SmallImageSource="{TemplateBinding SmallImageSource}" IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsDropDownOpen, Mode=TwoWay}" Label="{TemplateBinding Label}"/>
8393行附近 change the code: add code Label="{TemplateBinding Label}" 最后一行
<Canvas> <ribbon:RibbonToggleButton x:Name="PART_PopupToggleButton" AutomationProperties.Name="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(AutomationProperties.Name)}" Canvas.Top="-24" Canvas.Left="3" IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsDropDownOpen}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" Style="{StaticResource Ü}" Focusable="False" Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Height}" Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Width}" Label="{TemplateBinding Label}"/>
- RibbonApplicationMenu - Label 设置不启作用
- label不知道的作用
- label设置字数超出不换行
- <label></label>标签的作用。
- ExtJs设置文本框隐藏时label不隐藏的解决办法
- label的作用
- label的作用
- EXTJS4 设置label 样式
- GUI.Label 字体大小设置
- WPF 设置 Label.MouseDoubleClickEvent
- label设置行间距
- 设置Label圆角
- Label设置行间距
- iOS label设置 font
- Label设置行间距
- 设置label的内边距
- c# label的设置
- 设置label不同颜色
- 数据库关联映射建表图示(一对多、多对多)
- LeetCode String to Integer (atoi)
- 奇妙的变化
- 登陆用户怎样获取验证码和保存用户到cookie中
- Fibonacci数列问题
- RibbonApplicationMenu - Label 设置不启作用
- conflicting types for ...
- NSMutableArray的正确使用
- ndk开发过程中中文乱码问题的解决方案
- ubuntu 切换到 root 身份
- 浮点数
- Openstack 命令
- 冒泡排序
- 统计A出现的次数