I am trying to use the contextmenu with menu items in the toolkit of silverlight. I am working with Silverlight 4.0 and the toolkit is 5.0 (maybe that is the problem to begin with) and it does not let me add a simple Context menu.
I add my reference to the code in the reference folder and select the DLL System.Windows.Controls.Toolkit and System.Windows.Controls.Input.Toolkit. I then add a reference in the XAML file like this:
xmlns:controlsInputToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
and I have also tried like this:
xmlns:tk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
I add a simple code like this:
<navigation:Page x:Class="SilverlightApplication6.Page1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:tk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
d:DesignWidth="640" d:DesignHeight="480"
Title="Page1 Page">
<Grid>
<tk:ContextMenuService.ContextMenu>
<tk:ContextMenu>
<tk:Separator/>
</tk:ContextMenu>
</tk:ContextMenuService.ContextMenu>
</Grid>
</navigation:Page>
and I get this error:
The tag 'ContextMenu' does not exist in XML namespace 'http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit'
So, I am either not adding the right reference or there is something messed up in the files or the version of the files.