找不到Silverlight ContextMenu [英] Silverlight ContextMenu was not found

查看:75
本文介绍了找不到Silverlight ContextMenu的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这就是我现在在Canvas标签中所拥有的。我一直在尝试使用适合年龄的右键菜单。

This is what I've got inside a Canvas tag right now. I've been trying to get a right click menu working for ages.

<controlsInputToolkit:ContextMenuService.ContextMenu>
   <controlsInputToolkit:ContextMenu>
      <controlsInputToolkit:MenuItem Header="Move Up" Click="MoveUp_Click">
         <controlsInputToolkit:MenuItem.Icon>
            <Rectangle Width="16" Height="16" Fill="{StaticResource MoveUpBrush}"/>
         </controlsInputToolkit:MenuItem.Icon>
      </controlsInputToolkit:MenuItem>
      <controlsInputToolkit:MenuItem Header="Move Down" Click="MoveDown_Click">
         <controlsInputToolkit:MenuItem.Icon>
            <Rectangle Width="16" Height="16" Fill="{StaticResource MoveDownBrush}"/>
         </controlsInputToolkit:MenuItem.Icon>
      </controlsInputToolkit:MenuItem>
      <controlsInputToolkit:Separator/>
         <controlsInputToolkit:MenuItem Header="Delete" Click="Delete_Click">
            <controlsInputToolkit:MenuItem.Icon>
               <Rectangle Width="16" Height="16" Fill="{StaticResource DeleteBrush}"/>
            </controlsInputToolkit:MenuItem.Icon>
         </controlsInputToolkit:MenuItem>
      </controlsInputToolkit:ContextMenu>
   </controlsInputToolkit:ContextMenuService.ContextMenu>

我刚刚从以下代码中解决了该代码: http://www.silverlight.net/content/samples/sl4/toolkitcontrolsamples/run/default.html

I've just coped that code from: http://www.silverlight.net/content/samples/sl4/toolkitcontrolsamples/run/default.html

我得到的错误是:


"在类型'ContextMenuService'中找不到可附加属性'ContextMenu' 。

"The attachable property 'ContextMenu' was not found in type 'ContextMenuService'."

未找到类型 controlsInputToolkit:ContextMenu。验证您没有丢失程序集引用,并且所有引用的程序集都已生成。

"The type 'controlsInputToolkit:ContextMenu' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been build."

还有其他类似的东西。我发现解决此问题的唯一线索可能与该工具包有关,不是参考了正确版本的Silverlight?

And a whole bunch of others like that. The only clue I've found to solve this problem had something to do with maybe the toolkit wasn't referencing the right version of Silverlight?

因为我确实只有Silverlight 3,然后我下载了我认为的Silverlight 5内容,这就是我的项目所在的位置。除了我不知道如何查看Toolkit实际引用的内容,或者不知道如何更改它。

Because I did have only Silverlight 3, and then I downloaded the stuff for Silverlight 5 I think, and that's what my project is in. Except I have no idea how to see what the Toolkit's actually referencing, or how to change that.

推荐答案

您必须提供以下dll的引用。

Hi You have to give reference of following dll.

 System.Windows.Controls.Input.dll
 System.Windows.Controls.Toolkit.dll
 System.Windows.Controls.Input.Toolkit.dll

这篇关于找不到Silverlight ContextMenu的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆