This project is read-only.
1

Closed

UserControlBehavior is built with an older version of the Blend SDK

description

"The type 'UserControlBehavior' from assembly 'Catel.MVVM' is built with an older version of the Blend SDK, and is not supported in a Windows Presentation Framework 4 project."

I see this error in VS2012 on WPF .NET 4.5 project. In spite of this project is build without any errors.

The same issue with KeyTrigger, UpdateBindingOnPasswordChanged.

file attachments

Closed Oct 30, 2012 at 7:57 PM by GeertvanHorrik

comments

GeertvanHorrik wrote Oct 29, 2012 at 7:21 PM

That is interesting. I updated all external assemblies. Are you sure you are doing everything correctly? If you create a WPF 4.5 project, try to uninstall the package and re-install it to the project.

inTagger wrote Oct 29, 2012 at 10:10 PM

Look at this project. All visual states changes work and also my custom attached property works.
Then uncomment these lines in LoginView.xaml:
<!-- <i:Interaction.Behaviors> <catel:UserControlBehavior ViewModelType="WpfApplication3:LoginViewModel"/> </i:Interaction.Behaviors>--> and try to get all these stuff work again.

inTagger wrote Oct 29, 2012 at 10:14 PM

Also look at the Errors list after successfull rebuild while LoginView.xaml is opened in VS2012.

inTagger wrote Oct 29, 2012 at 10:51 PM

Okay, I fixed bug with my attached property.
There is only problem left is GoToStateAction doesn't work with catel:UserControlBehavior attached. look at LoginView.xaml it has 2 such actions.

Updated sources in CatelBug-WpfApplication3-2.zip

GeertvanHorrik wrote Oct 30, 2012 at 9:39 AM

I am sorry, I cannot reproduce this (using the second package). Can you give me the exact steps to reproduce?

Can you check the location of your System.Windows.Interactivity.dll reference path?

inTagger wrote Oct 30, 2012 at 11:48 AM

  1. Check out how the app CatelBug-WpfApplication3-2.zip works without any changes.
  2. Then uncomment these lines in LoginView.xaml:
<!-- <i:Interaction.Behaviors> <catel:UserControlBehavior ViewModelType="WpfApplication3:LoginViewModel"/> </i:Interaction.Behaviors>-->
  1. Check again the behavior. GoToStateActions should not work.
\WpfApplication3\packages\Catel.MVVM.3.3.1210291812-beta\lib\net45\System.Windows.Interactivity.dll
Version 4.5.0.0.

inTagger wrote Oct 30, 2012 at 5:31 PM

I have done some research. The actual problem is that VisualStateUtilities.GoToState(stateTarget, StateName, UseTransitions) method called for UserControl as stateTarget in GoToStateAction. But this doesn't work when there is catel:UserControlBehavior attached. It is really called with the same parameters but state doesn't change.
On the other hand I have VisualStateUtilities.GoToState() method called in my StateHelper.State attached property for Grid element, this call always affect the real state of the element.

inTagger wrote Oct 30, 2012 at 5:52 PM

Finally fixed problem with GoToStateAction, just changed TargetObject to Grid, which contains VisualStateManager. Now it works with catel:UserControlBehavior behavior also.

GeertvanHorrik wrote Oct 30, 2012 at 6:38 PM

Cool, so if I understand correctly, this issue is fixed?

inTagger wrote Oct 30, 2012 at 7:24 PM

Actually there were two separate issues, I think. And also I have fixed issue with "older version of the Blend SDK":
1: Uninstalling Catel nugets;
2: Added reference to System.Windows.Interactivity 4.5;
3: Install Catel again.

GeertvanHorrik wrote Oct 30, 2012 at 7:56 PM

Cool, that's what I meant with re-installing. I will close the issue.

vinoar wrote Apr 15, 2013 at 8:45 AM

Hi
Can you remove this reference System.Windows.Interactivity 4.5
and add System.Windows.Interactivity 4.0

then its work

GeertvanHorrik wrote Apr 15, 2013 at 5:32 PM

Did you try the latest beta via nuget? I have recently updated all versions per target framework (NET40, NET45, SL4, SL5, WP7, WP8) so they should all work.