请教WPF4.5的RibbonWindow和Ribbon如何用

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了请教WPF4.5的RibbonWindow和Ribbon如何用相关的知识,希望对你有一定的参考价值。

参考技术A <ribbon:RibbonWindow
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:prism="http://www.codeplex.com/prism"
xmlns:nimax="http://cyberstone.com/nidaqmax"
xmlns:ribbon="http://schemas.microsoft.com/winfx/2006/xaml/presentation/ribbon"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:cmd="clr-namespace:ConfigrationStudio.Infrastructure.Command;assembly=ConfigrationStudio.Infrastructure"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Icon="/Resources/app.ico"
mc:Ignorable="d" x:Class="ConfigrationStudio.Shell" Height="768" Width="1024" WindowState="Maximized" WindowStyle="SingleBorderWindow" Background="DynamicResource x:Static SystemColors.ControlBrushKey">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="240"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<ribbon:Ribbon ContextMenu="x:Null" x:Name="Ribbon" Margin="0,4,0,4" prism:RegionManager.RegionName="RibbonRegion" Grid.ColumnSpan="2" Title="自动化集成配置环境">
<ribbon:Ribbon.QuickAccessToolBar>
<ribbon:RibbonQuickAccessToolBar VerticalAlignment="Center">
<ribbon:RibbonButton Command="x:Static cmd:GlobalCmds.Save" SmallImageSource="/Resources/save.png"/>
</ribbon:RibbonQuickAccessToolBar>
</ribbon:Ribbon.QuickAccessToolBar>
<ribbon:Ribbon.ApplicationMenu>
<ribbon:RibbonApplicationMenu SmallImageSource="/Resources/StartMenu.png">
<ribbon:RibbonApplicationMenuItem Header="退出" ImageSource="/Resources/exit.png" Command="x:Static cmd:GlobalCmds.Exit"/>
</ribbon:RibbonApplicationMenu>
</ribbon:Ribbon.ApplicationMenu>
<ribbon:RibbonTab Header="文件" prism:RegionManager.RegionName="FileExtenGroupRegion" >
<ribbon:RibbonGroup Header="配置文件">
<ribbon:RibbonButton LargeImageSource="/Resources/openfolder.png" ToolTip="打开配置文件" Label="打开" Command="x:Static cmd:GlobalCmds.OpenFile"/>
<ribbon:RibbonButton LargeImageSource="/Resources/addfile.png" ToolTip="新建配置文件" Label="新建" Command="x:Static cmd:GlobalCmds.NewFile"/>
<ribbon:RibbonButton LargeImageSource="/Resources/save.png" ToolTip="保存当前配置文件" Label="保存" Command="x:Static cmd:GlobalCmds.Save"/>
<ribbon:RibbonButton LargeImageSource="/Resources/saveall.png" ToolTip="当前配置文件另存为" Label="另存为" Command="x:Static cmd:GlobalCmds.SaveAs"/>
</ribbon:RibbonGroup>
<ribbon:RibbonGroup Header="工具" prism:RegionManager.RegionName="FileToolRegion">
<ribbon:RibbonButton LargeImageSource="/Resources/test.png" ToolTip="测试当前配置文件" Label="测试" Command="x:Static cmd:GlobalCmds.Test"/>
<ribbon:RibbonButton LargeImageSource="/Resources/stoptest.png" ToolTip="停止测试当前配置文件" Label="停止测试" Command="x:Static cmd:GlobalCmds.StopTest"/>
</ribbon:RibbonGroup>
<ribbon:RibbonGroup Header="通用">
<ribbon:RibbonButton LargeImageSource="/Resources/editfile.png" ToolTip="退出应用程序" Label="复制" Command="Copy"/>
<ribbon:RibbonButton LargeImageSource="/Resources/cut.png" ToolTip="退出应用程序" Label="剪切" Command="Cut"/>
<ribbon:RibbonButton LargeImageSource="/Resources/Paste.png" ToolTip="退出应用程序" Label="粘贴" Command="Paste"/>
</ribbon:RibbonGroup>
<ribbon:RibbonGroup Header="程序">
<ribbon:RibbonButton LargeImageSource="/Resources/exit.png" ToolTip="退出应用程序" Label="退出" Command="x:Static cmd:GlobalCmds.Exit"/>
</ribbon:RibbonGroup>
</ribbon:RibbonTab>
<ribbon:RibbonTab Header="变量" prism:RegionManager.RegionName="VariableExtenGroupRegion" >
<ribbon:RibbonGroup Header="基本">
<ribbon:RibbonButton LargeImageSource="/Resources/exit.png" ToolTip="退出应用程序" Label="退出" Command="x:Static cmd:GlobalCmds.Exit"/>
</ribbon:RibbonGroup>
</ribbon:RibbonTab>
<ribbon:RibbonTab Header="触发" prism:RegionManager.RegionName="TriggerExtenGroupRegion" >
<ribbon:RibbonGroup Header="基本">
<ribbon:RibbonButton LargeImageSource="/Resources/exit.png" ToolTip="退出应用程序" Label="退出" Command="x:Static cmd:GlobalCmds.Exit"/>
</ribbon:RibbonGroup>
</ribbon:RibbonTab>
</ribbon:Ribbon>
<ItemsControl Grid.Row="1" Margin="5,0,5,5" prism:RegionManager.RegionName="NavgateRegionItem" Background="White" BorderBrush="Gray" BorderThickness="1">
<Button Margin="2" Content="标准IVI仪器驱动配置"/>
</ItemsControl>
<GridSplitter Grid.Row="1" HorizontalAlignment="Right" Width="5" Background="LightGray"/>
<ContentControl Margin="0,0,5,0" Grid.Row="1" Grid.Column="1" prism:RegionManager.RegionName="WorkspaceRegion"/>
</Grid>
</ribbon:RibbonWindow>本回答被提问者和网友采纳

您好!看到您公司WPF用的很多,有个关于WPF问题想请教您

WPF中怎样给图片上添加文字呢?类似于水印的那种效果。

参考技术A 用ImageBrush 参考技术B 你在Image控件上加一个textblock不就行了么

以上是关于请教WPF4.5的RibbonWindow和Ribbon如何用的主要内容,如果未能解决你的问题,请参考以下文章

WPF RibbonWindow + Ribbon = 屏幕外的标题?

FIB表与RIB表的区别与联系

rib fib arp fdb

Superprime Rib

2319__1.5.3 Superprime Rib 特殊的质数肋骨

洛谷P1218 [USACO1.5]特殊的质数肋骨 Superprime Rib