WPF setting a MenuItem.Icon in code
menutItem.Icon = new System.Windows.Controls.Image
{
Source = new BitmapImage(new Uri("images/sample.png", UriKind.Relative))
};
<MenuItem>
<MenuItem.Icon>
<Image>
<Image.Source>
<BitmapImage UriSource="/your_assembly;component/your_path_here/Image.png" />
</Image.Source>
</Image>
</MenuItem.Icon>
</MenuItem>
Just make sure your image in also included in the project file and marked as resource, and you are good to go :)