Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Frameworks which provide Behavior<T> in .NET Core 3 / WPF

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?

like image 572
Dr. Andrew Burnett-Thompson Avatar asked May 07 '19 12:05

Dr. Andrew Burnett-Thompson


3 Answers

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.

like image 87
Grzegorz Smulko Avatar answered Sep 28 '22 17:09

Grzegorz Smulko


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.

like image 39
Dr. Andrew Burnett-Thompson Avatar answered Sep 28 '22 17:09

Dr. Andrew Burnett-Thompson


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).

like image 22
Marco Goertz - MSFT Avatar answered Sep 28 '22 18:09

Marco Goertz - MSFT