How to programmatically add a RibbonTab to WPF Ribbon (October 2010 release)?

Does anybody know a way to programatically add a RibbonTab to a Mircosoft WPF Ribbon? I can't find an example or at least a property to use in neither documentation nor Ribbon's intellisense.

I found many entries all over the web suggesting something like: ribbon.Tabs.Add(...)

Unfortunately "Tabs" doesn't exist in the Ribbon class at all?! Was there an API change I can't find anything about or what's the trick?

Answers


The Microsoft WPF Ribbon inherits from Selector, which inherits from ItemsControl. With that in mind, to add a tab programmatically, you would use the Items property to add the new RibbonTab object.

For example,

Ribbon.Items.Add(new RibbonTab())

Need Your Help

Maximum call stack size exceeded error

javascript html webkit callstack dwr

I am using a Direct Web Remoting (DWR) JavaScript library file and am getting an error only in Safari (desktop and iPad)

OWIN/Identity Framework

c# asp.net-identity owin

I have a class library with a SignIn method with a lot of logic in order for a member to sign in. The problem that I am facing is that I add a claim of "Fullname" to the identity and it works fine,...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.