C# 为什么尝试在WPF中使用行为时会出错?
我试图使用行为来处理WPF中按钮的单击事件C# 为什么尝试在WPF中使用行为时会出错?,c#,wpf,prism,C#,Wpf,Prism,我试图使用行为来处理WPF中按钮的单击事件 <Button Content="Another Button" Width="100" IsEnabled="True"> <i:Interaction.Triggers> ... </i:Interaction.Triggers> </Button> ... 但是,我收到以下错误消息: 在类型“Interaction”中找不到可附加属性“Trigge
<Button Content="Another Button" Width="100" IsEnabled="True">
<i:Interaction.Triggers>
...
</i:Interaction.Triggers>
</Button>
...
但是,我收到以下错误消息:
在类型“Interaction”中找不到可附加属性“Triggers”
这是我的命名空间,用于i:xmlns:i=”http://schemas.microsoft.com/expression/2010/interactivity“
我还包括了System.Windows.Interactivity
assembly。我认为这就是我使用行为所需要做的一切,但显然有些地方出了问题 这听起来像是一场灾难。如果您使用的是VS 2008,则可能会更正此问题(尽管有时在安装后我仍会遇到问题)
此行为已在Visual Studio 2010中更正。对于Visual Studio 2010,您需要包含来自Expression Blend的以下3个引用:System.Windows.Interactive、Microsoft.Expression.Controls和Microsoft.Expression.Interactions 您正在使用哪个版本的visual studio?