WPF and Silverlight Edition Basic Library / Menu and ContextMenu / Menu and ContextMenu Elements / Adding Icons
Adding Icons

You can add an icon to a C1MenuItem in either XAML or Code

Complete the following steps:

  1. Add an icon image to your Silverlight project. A 12x12 pixel image is best.
  2. Add the following XAML markup between the <c1:C1MenuItem> and </c1:C1MenuItem> tags, replacing the value of the Source property with your image's name:
XAML
Copy Code
<c1:C1MenuItem.Icon>
     <Image Source="YourImage.png" Height="12" Width="12" Margin="5,0,0,0"/>
</c1:C1MenuItem.Icon>
  1. Run the project.