I’d like to have customizable toolbars in my application, like those offered by Visual Studio 2008 (right click on toolbar, customize). I need a WPF solution, and I haven’t been able to find any (neither on SO, or Google). I did find this Visual Studio 2010 blog entry, which implies that even Microsoft had some trouble doing it. So anyway, to keep it simple, the question is, is there any open source/free framework that provides this functionality (it doesn’t have to be exact replica of VS2008’s solution).
I’d like to have customizable toolbars in my application, like those offered by Visual
Share
I just played around for a bit and I think it should be relatively easy to implement the desired behavior with WPF alone (no additional library or framework required). I included example code to add a
Buttonto aToolBarwhich in turn allows to add more buttons to the toolbar.To get your desired behavior I’d have a collection of buttons for the toolbar and another collection with available buttons. The toolbars
ItemsSourcewould be bound to the first collection. After clicking the “customize” button in the context menu I’d just show another form with twoListViews(each bound to one of the collections) and buttons to add/remove the buttons in the complete collection to/from the toolbars collection. HTH.Code:
XAML: