Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Upgrasded to .NET 4.5 and now get "Cannot add instance of XXX to a collection of type TriggerActionCollection. Only items of T are allowed"

$
0
0

I have a class called GenericClickCommander that extends System.Windows.Interactivity.TriggerAction<FrameworkElement>.  In XAML I have;

<I:Interaction.Triggers>

<I:EventTrigger EventName="MouseDoubleClick">

<s:GenericClickCommander Command={Binding Path=XXX} />

</I:EventTrigger>

</I:Interaction.Triggers>

This builds and works fine in .NET 4.0.  After upgrading the projects to 4.5 is fails in both the designer and at runtime;

XamlParseException: 'Add value to collection of type 'System.Windows.Interactivity.TriggerActionCollection' threw an exception.' Line number '91' and line position '43'.

ArgumentException: Cannot add instance of type 'GenericClickCommander' to a collection of type 'TriggerActionCollection'. Only items of type 'T' are allowed.


Any ideas?

 


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>