无法将“PopupWindowAction"类型的值添加到“TriggerActionCollection"类型的集合或字典中 [英] A value of type 'PopupWindowAction' cannot be added to a collection or dictionary of type 'TriggerActionCollection'
问题描述
请参阅Prism 手册我制作了模态视图并将其粘贴到主视图中,如下所示:
但是我在
中遇到了编译时错误(在运行时一切都很完美):><块引用>
错误 3 无法将PopupWindowAction"类型的值添加到TriggerActionCollection"类型的集合或字典中.
在我的项目中,我使用 PRISM 5 和 .NET 4.5
UDP:
命名空间的定义(在 baseView:BaseView
中)如下:
xmlns:prism="http://www.codeplex.com/prism";xmlns:i=http://schemas.microsoft.com/expression/2010/interactivity"
参考文献:
<块引用>Microsoft.Practices.Prism.Interactivity 5.0.0.0 版
System.Windows.Interactivity 版本 4.5.0.0
您使用的是 Visual Studio 2015 吗?我在 VS 2015 中遇到了类似的问题,但在 VS 2013 中没有,我首先认为 Prism 框架中的二进制文件有问题.我在 Prism GitHub 上发布了一个问题:
https://github.com/PrismLibrary/Prism/issues/213
最终对我有用的事情是重新安装 VS 2015.我怀疑 VS 2015 的一些可选扩展/插件导致了这个问题.希望这也能解决您的问题.
Refer to Prism manual I made my modal view and pasted it in main view like this:
<baseView:BaseView ... >
<i:Interaction.Triggers>
<prism:InteractionRequestTrigger SourceObject="{Binding DocumentSelectionRequest, Mode=OneWay}">
<prism:PopupWindowAction IsModal="True">
<prism:PopupWindowAction.WindowContent>
<modal:DocumentSelectionView />
</prism:PopupWindowAction.WindowContent>
</prism:PopupWindowAction>
</prism:InteractionRequestTrigger>
</i:Interaction.Triggers>
<Grid>
...
</Grid>
</baseView:BaseView>
But I have got the compile time error in <prism:PopupWindowAction IsModal="True">
(in run time everything is perfect):
Error 3 A value of type 'PopupWindowAction' cannot be added to a collection or dictionary of type 'TriggerActionCollection'.
In my project I use PRISM 5 and .NET 4.5
UDP:
Namespaces are defined (in baseView:BaseView
) like:
xmlns:prism="http://www.codeplex.com/prism"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
References:
Microsoft.Practices.Prism.Interactivity Version 5.0.0.0
System.Windows.Interactivity Version 4.5.0.0
Are you using Visual Studio 2015? I was having a similar problem with VS 2015, but not in VS 2013, and I first thought something was wrong with the binaries from the Prism framework. I posted an issue on the Prism GitHub:
https://github.com/PrismLibrary/Prism/issues/213
The thing that worked for me, eventually, was reinstalling VS 2015. I suspect that some of the optional extensions/plugins for VS 2015 was causing the problem. Hopefully this will solve your troubles too.
这篇关于无法将“PopupWindowAction"类型的值添加到“TriggerActionCollection"类型的集合或字典中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!