在 Xaml 中为 VisualStateManager 指定命名空间时出现问题
应该很简单,但我似乎找不到答案
,我正在尝试制作一个使用 VisualStateManger 的自定义 ControlTemplate。 MSDN 说要包含
xmlns:vsm="clr-namespace:System.Windows; assembly=System.Windows"
但是,它说我缺少对程序集的引用。所以我尝试添加它,但在 .NET 选项卡下找不到 System.Windows 程序集来添加它。我缺少什么?
谢谢
Should be simple but i can't seem to find the answer
I am trying to make a custom ControlTemplate that uses VisualStateManger. MSDN says to include
xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
However, it says that i am missing a reference to the assembly. So i try to add it but can't find System.Windows assembly under the .NET tab to add it. What am i missing?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要对
PresentationFramework.dll
的引用(来自 VisualStateManager 文档)。您还需要确保您的目标是 .NET 4.0,而不是 3.5sp1。
VisualStateManager
已添加到 .NET 4 中的 WPF 中。You need a reference to
PresentationFramework.dll
(from VisualStateManager documentation).You'll also need to make sure that you're targetting .NET 4.0, not 3.5sp1.
VisualStateManager
was added to WPF in .NET 4.如果您运行的是 .net 4.5,那么您的参考需要从
http://schemas.microsoft.com/winfx/2006/xaml/presentation到
http://schemas.microsoft.com/netfx/2007/xaml/presentation
If you are running .net 4.5 then your reference needs to change from
http://schemas.microsoft.com/winfx/2006/xaml/presentation to
http://schemas.microsoft.com/netfx/2007/xaml/presentation