Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ribbon feature using .Net 4.5

Tags:

.net

wpf

.net-4.5

So I was looking for new features in .Net 4.5 and I found that ribbon is now native API for it. I tried a program in WPF using it by including "System.Windows.Controls.Ribbon.dll" and followed the example given on msdn added

 "xmlns:ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"

but got the error Error 1 The type or namespace name 'Controls' does not exist in the namespace 'Microsoft.Windows' (are you missing an assembly reference?) c:\users\ABC\documents\visual studio 11\Projects\WpfApplication1\WpfApplication1\obj\Debug\MainWindow.g.cs 12 25 WpfApplication1"

I didn't find any "Microsoft.Windows.Controls.Ribbon" to be added, I searched through internet but couldn't find ribbon in refrence to .Net 4.5 , though there r lot for .Net4 as some external API. Didn't get any answer even on MSDN forum. Does anyone working on .net 4.5 knows what I am missing in the example ? "http://msdn.microsoft.com/en-us/library/system.windows.controls.ribbon.ribbon(v=vs.110).aspx " aforementioned example is on this site.

like image 557
uncia Avatar asked Apr 11 '12 05:04

uncia


1 Answers

Add a reference to

System.Windows.Controls.Ribbon

Then you can use <Ribbon> in your XAML, without the extra clutter.

<Window x:Class="Test"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Ribbon>
            <!-- controls -->
        </Ribbon>
    </Grid>
</Window>

But as I look over your code, the namespace is System.Windows. ..., not Microsoft.Windows. ...

like image 112
Thomas Avatar answered Nov 14 '22 12:11

Thomas