A value of type 'PopupWindowAction' cannot be added to a collection or dictionary of type 'TriggerActionCollection'

醉酒当歌 提交于 2019-12-25 06:38:34

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/32696822/a-value-of-type-popupwindowaction-cannot-be-added-to-a-collection-or-dictionar

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!