melculetz
melculetz

Reputation: 1971

Icon not displayed for RibbonMenuItem

I have the following code inside a RibbonSplitButton (which rendered correctly on the 3.5 ribbon CTP verion). I tried to view it using the WPF Ribbon 4.0 library, but it's just not rendering the Icon. Any idea why?

<ribbon:RibbonMenuItem Header="Option 3 - icon">
                            <ribbon:RibbonMenuItem.Icon>
                                <Image Width="16" Height="16" Source="Images/wizard-icon16.png"></Image>
                            </ribbon:RibbonMenuItem.Icon>
                        </ribbon:RibbonMenuItem>

Upvotes: 7

Views: 1637

Answers (4)

Kay
Kay

Reputation: 70

Try setting the image's build action to Resource

Upvotes: 0

Mark
Mark

Reputation: 1894

Don't use the Icon property, that is inherited from MenuItem, and isn't used by the Ribbon control. Use the ImageSource property instead.

Upvotes: 7

Ido Ran
Ido Ran

Reputation: 11424

I also see the same problem. I've try to put even simple text in the Icon property but it just does not show anything. I've check the control template and there is just no binding to the Icon property in it. You can use ImageSource to put an image in the menu item icon's place.

I guess it simply bad control template.

Upvotes: 4

kevindaub
kevindaub

Reputation: 3363

Add a forward slash in front of Images and do a Rebuild Solution. This is assuming the Images directory is located at the root of your project.

Is the image's build action set to Content?

HTH

Upvotes: 0

Related Questions