Quantcast
Channel: Silverlight Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 801

Commented Issue: Set ContextMenu MenuItem Header in code not available [6199]

$
0
0
I'm trying to create a context menu with menu items in codebehind for a control but when you cannot set the MenuItem Header in code behind

ContextMenu menu = new ContextMenu();
MenuItem item = new MenuItem();
item.Header ??? not supported or available

menu.Items.Add(item);

Control.SetValue(ContextMenuService.ContextMenuProperty,menu);

Please advise if i'm doing something wrong.
Comments: ** Comment from web user: heni86_2003 **

Hi,

You must add this reference : System.Windows.Controls


Viewing all articles
Browse latest Browse all 801

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>