Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Microsoft.Xaml.Behaviors.Wpf instead the System.Windows.Interactivity #3402

Merged
merged 1 commit into from
Dec 11, 2018

Conversation

punker76
Copy link
Member

Describe the changes you have made to improve this project

Use Microsoft.Xaml.Behaviors.Wpf as dependency from NuGet instead the System.Windows.Interactivity.dll

This will remove the reference to System.Windows.Interactivity.dll which is sometimes bad for other projects which are also use this dll.

With this change it's necessary to change the namespace too, so this is a breaking change for all others too.

https://blogs.msdn.microsoft.com/dotnet/2018/12/10/open-sourcing-xaml-behaviors-for-wpf/

Unit test

-/-

Additional context

Steps to migrate:

  1. Remove reference to Microsoft.Expression.Interactions and System.Windows.Interactivity
  2. Install the Microsoft.Xaml.Behaviors.Wpf NuGet package.
  3. XAML files – replace the xmlns namespaces http://schemas.microsoft.com/expression/2010/interactivity and http://schemas.microsoft.com/expression/2010/interactions with http://schemas.microsoft.com/xaml/behaviors
  4. C# files – replace the usings in c# files Microsoft.Xaml.Interactivity and Microsoft.Xaml.Interactions with Microsoft.Xaml.Behaviors

Closed Issues

Closes #3400

@punker76 punker76 added this to the 2.0.0 milestone Dec 11, 2018
@punker76 punker76 merged commit 72f69b3 into develop Dec 11, 2018
@punker76 punker76 deleted the feature/Microsoft.Xaml.Behaviors.Wpf branch December 11, 2018 23:14
@rabiadhikari
Copy link

Could you please elaborate how to use the behaviors dll as embedded resources? The Windows Interactivity dll worked quite nicely and I am having difficulty using the same for behaviors. Any pointers to some examples would be fantastic.

@punker76
Copy link
Member Author

punker76 commented Dec 6, 2019

@rabiadhikari I think it should be the same. Or you can try using Costura Fody and use their embedded fantastic job.

@rabiadhikari
Copy link

Thank you @punker76 for your suggestion. Loading dll into the app isn't the issue. My codes worked when using Windows Interactivity dll while when I changed the references to Behaviors.Wpf, the same code doesn't work as expected. Perhaps I am missing something and thus wondering to see an example if someone could point me to one. Googling hasn't helped so far thus the request. I am using Relay command and other setup for MVVM with WPF. Output file is a DLL document to be used as Addin.

@punker76
Copy link
Member Author

punker76 commented Dec 6, 2019

@rabiadhikari The namespace is different to the old one, so you should check this.

For XAML

xmlns:i="http://schemas.microsoft.com/xaml/behaviors"

and for code behind

using Microsoft.Xaml.Behaviors;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Use Microsoft.Xaml.Behaviors.Wpf instead the System.Windows.Interactivity
2 participants