简体   繁体   English

功能区未显示在XAML中

[英]Ribbon not showing in XAML

How can I get the link that looks like this 我如何获得看起来像这样的链接

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition/>
    </Grid.RowDefinitions>
    <Ribbon x:Name="RibbonWin"  SelectedIndex="0">          
        </Ribbon>        
</Grid>

I get an error saying 我说错了

The type 'Ribbon' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.

I added the Windows.System.Controls.Ribbon reference 我添加了Windows.System.Controls.Ribbon参考

I've also added the reference path as documented on https://msdn.microsoft.com/en-us/library/6taasyc6(v=vs.80).aspx 我还添加了https://msdn.microsoft.com/zh-cn/library/6taasyc6(v=vs.80).aspx中记录的参考路径

I am using WPF with .Net framework 4.5 on Windows 8.1 我在Windows 8.1上将WPF与.Net Framework 4.5一起使用

The application must run on Windows 7 (and higher) 该应用程序必须在Windows 7(及更高版本)上运行

You'll need to add the Ribbon control to the Toolbox in VS2015, then simply drag-and-drop the Ribbon-associated controls (eg Ribbon Tab, Ribbon Group, Ribbon Button, etc) from the Toolbox into your previously-added Ribbon in the MainWindow.xaml form at design-time. 您需要在VS2015中将“ 功能区”控件添加到“ 工具箱”中,然后只需将与“功能区”相关的控件(例如,“功能区选项卡”,“功能区组”,“功能区按钮”等)拖放到您先前添加的“功能区”中在设计时MainWindow.xaml窗体。

To add the Ribbon control to the Toolbox in VS2015, simply right-click within the Toolbox in VS2015 (with your project opened), select the Choose Items... option which will bring you to the Choose Toolbox Items dialog window (as depicted in the screenshot below), from which you will select the WPF Components tab, then scroll down and check all the options which pertain to the Ribbon controls to add them to your Toolbox when you click on OK. 要将功能区控件添加到VS2015中的“工具箱”中,只需在VS2015中的“工具箱”中右键单击(打开项目),选择“选择项...”选项,这将带您进入“选择工具箱项”对话框窗口(如下面的屏幕截图),从中选择“ WPF组件”选项卡,然后向下滚动并选中与功能区控件相关的所有选项,以在单击“确定”时将其添加到工具箱中。

Screenshot of the Choose Toolbox Items dialog window: 选择工具箱项”对话框窗口的屏幕快照: “选择工具箱项”对话框窗口的屏幕快照

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM