Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF setting a MenuItem.Icon in code

I have an images folder with a png in it. I would like to set a MenuItem's icon to that png. How do I write this in procedural code?

like image 760
ScottG Avatar asked Aug 27 '08 14:08

ScottG


1 Answers

menutItem.Icon = new System.Windows.Controls.Image         {             Source = new BitmapImage(new Uri("images/sample.png", UriKind.Relative))         }; 
like image 120
Timothy Fries Avatar answered Sep 19 '22 14:09

Timothy Fries