10

The Behavior class from System.Windows.Interactivity is used in an application I'm working on and this is being ported to .NET Core 3.0 / WPF Desktop.

There doesn't seem to be an equivalent for this class, as System.Windows.Interactivity is built against the .NET Framework.

Are there any alternatives out there?

Dr. Andrew Burnett-Thompson
  • 20,980
  • 8
  • 88
  • 178

3 Answers3

18

This answer describes in details what needs to be done: https://stackoverflow.com/a/56240223/532575 .

In short, the Microsoft.Xaml.Behaviors.Wpf NuGet package is a replacement for Microsoft.Expression.Interactions and System.Windows.Interactivity.

Grzegorz Smulko
  • 2,525
  • 1
  • 29
  • 42
5

You can use the .NET Framework version of the WPF Behaviors in your .NET Core 3 project as is - it is 100% compatible (the build warning is ignorable).

3

I realised my question was a bit thick as these packages are Open Source...

So I've solved the problem by cloning microsoft/XamlBehaviorsWpf and including the source for Behavior and dependencies in my .NET Core 3 application.

Dr. Andrew Burnett-Thompson
  • 20,980
  • 8
  • 88
  • 178
  • 3
    For future readers: There's a nuget package as well https://www.nuget.org/packages/Microsoft.Xaml.Behaviors.Wpf as mentioned by @grzegorz-smulko – TorbenJ Dec 14 '20 at 08:32