Menu separator does not display image

Ribbon for WPF Forum

Posted 12 years ago by Chris Bunker
Version: 11.2.0551
Platform: .NET 4.0
Environment: Windows 7 (64-bit)

If I attempt to add an image to a Separator, the image does not display.   I'd like to display the separator along with a label and image.   The documentation makes it appear that this is a supported case, because the Separator provides both ImageSourceSmall and ImageSourceLarge properties.  Here's the code I'm using to set the image...


<ribbon:Menu x:Key="MenuX">
    <ribbon:Separator Label="Test"  ImageSourceSmall="pack://application:,,,/MyLibrary.UI;component/Images/Large/Image.png"/>
    <ribbon:Button Label="X" ImageSourceSmall="pack://application:,,,/MyLibrary.UI;component/Images/Large/Image.png"/>


Notice that the Button element below the separator DOES show the image, so I know there is nothing wrong with loading the image.   Am I missing something?



Comments (3)

Answer - Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Chris,

I'm sorry but our menu context template for Separator doesn't render images.  You'd need to provide a custom template for it to do that.

Actipro Software Support

Posted 12 years ago by Chris Bunker

Thanks for the help.  After writing the default template to a file, it took some time to wade through the 6 or 7 control templates that are used depending upon the values of triggers.  I finally figured out which one was being used and updated it to add an image.  Is this the recommended approach?  If so, I'd recommend adding this process of creating custom control templates from the defaults to some FAQ, because it's not a trivial thing to do, in my opinion.


Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA

Yes, you can just set the Template property in XAML for that particular item, or create a reusable ControlTemplate resource in your App Resources for it and reference that.

Actipro Software Support

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.