简体   繁体   中英

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

I've also added the reference path as documented on https://msdn.microsoft.com/en-us/library/6taasyc6(v=vs.80).aspx

I am using WPF with .Net framework 4.5 on Windows 8.1

The application must run on Windows 7 (and higher)

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.

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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