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.

1
  • There is an addon library for .NET 4 to add a Ribbon control, .NET 4.5 integrates this into the Framework. However there are some changes (notably in namespaces). Many examples and forum posts are about the WPF4 addon and thus need some translation for WPF4.5.
    – Richard
    Apr 11, 2012 at 7:37

1 Answer 1

12

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. ...

3
  • as I mentioned in question I have added reference, the example given in msdn site for ribbon has microsoft.windows.controls.ribbon but I tried with namespace of Windows.controls.Ribbon but assembly doesn't exist, What would be assembly=" " I should use when using Windows.Conrols.Ribbon ? . I guess even Microsoft guys have given wrong example. Thanks for answering
    – uncia
    Apr 11, 2012 at 9:08
  • 1
    The assembly appears to be System.Windows.Controls.Ribbon.dll but the entire xmlns line is unnecessary.
    – Thomas
    Apr 11, 2012 at 9:28
  • thanks Thomas it worked " ribbon on msdn website I surmise is for some earlier addon not for .Net 4.5 "
    – uncia
    Apr 11, 2012 at 9:41

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.