Reputation: 897
How to create several MenuItems and add it to ContextMenu in windows phone 7 with C#?
I wrote this sample:
MenuItem q = new MenuItem();
q.Header = "something";
ContextMenu cM = new ContextMenu(q);
and in MSDN there's something about it, but it doesn't compile, because of construct of ContextMenu.
Upvotes: 0
Views: 1431
Reputation: 109139
You can add menu items as follows:
ContextMenu cm = new ContextMenu();
cm.Items.Add( new MenuItem() {
Header = "Item 1",
} );
Upvotes: 1
Reputation: 23157
The ContextMenu
isn't part of Wp7 natively. You need to look at the Silverlight Toolkit for WP7.
http://silverlight.codeplex.com/
Upvotes: 1