Custom Controls / Gallery / Color-Selector for WPF Ribbon

Dec 15, 2008 at 10:56 AM
Hello,

I was wondering whether anyone has any hints/tips or is aware of sample code or coding guidelines for implementing custom ribbon controls such as gallery controls, color-selector or pattern-selector etc?

I understand that I should implement the IRibbonControl interface, but that's about as much as I've gleaned so far.  I thought I'd ask before I start attempting to code something in a potentially incorrect manner.

Thanks,

Daniel
Coordinator
Dec 15, 2008 at 4:14 PM
Hi Daniel,

Yes, you'll need to implement the IRibbonControl interface.  Other things to keep in mind:

- Resizing.  You'll need to handle switching the layout of the control based on the size that's being dictated by the RibbonWrapPanel.  For example, you can use Triggers to change the size/layout of the icon and label based on the values of IsLabelVisible and ImageSize.  You can take a look at the templates for other Ribbon controls (RibbonButton, for example) to see how we handle this.
- ToolTip.  You'll want to automatically generate a RibbonToolTip for the control using the values of the ToolTip properties on RibbonCommand (TooltipTitle, TooltipDescription, etc.).  We do this in the CoerceToolTip method on our Ribbon controls if you'd like to see an example.

Also, we will have a Gallery control in V1 of the Ribbon, in case you don't want to put in too much time making one :-)

Thanks!
Samantha
Dec 15, 2008 at 4:39 PM
Thanks Samantha,

Are you saying that the source-code is available for these Ribbon controls?  Or are you just referring me to the meta-data generated class description?
Sorry, I'd probably understand if I were a seasoned WPF developer, but I'm normally writing C++.

I'll look forward to v1 of the Ribbon.  Is there likely to be a preview/beta release of this in advance of the final release?

Thanks again for your help & prompt reply,

Daniel
Coordinator
Dec 15, 2008 at 5:36 PM
Hi Daniel,

We're not currently shipping the source, but you can use .NET Reflector with the BamlViewer add-on to view the template and source that I mentioned above.

We're not sure yet if there's going to be another preview of the Ribbon before we release V1, but if there is, there will be a link posted on this site, so keep watching out for it here.

Thanks!
Samantha