I'm running into a problem with the new Expression Blend behaviors.
I have a customized Behavior<T>
class developed using the Expression Blend 3 SDK.
The behavior works properly, and the solution compiles. That is perfect. I have all of my references (System.Windows.Interactivity.dll + Microsoft.Expression.Interactions.dll) setup in my projects that reference the behavior.
In addition, as I mentioned, Visual Studio compiles the project fine.
However, if I load the XAML file in the Visual Studio designer, I get the following error after the solution compiles:
Error 1 The attachable property 'Behaviors' was not found in type 'Interaction'. C:\Path\To\MyFile.xaml 19 14 MyApplication
That line of the file is the first line of the following:
<Interactivity:Interaction.Behaviors>
<Behaviors:DoubleTextBoxBehavior />
</Interactivity:Interaction.Behaviors>
My window reference is setup with:
xmlns:Interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
I've even eliminated my custom behavior as a possibility. I can just include the following line, and "break" the designer:
<Interactivity:Interaction.Behaviors />
As far as I can tell, this should work. There shouldn't be an error. The compiler handles this fine, but Visual Studio won't load this in the designer any time I add the behavior line.
Does anybody have an idea of what can cause this, and how to fix it?
Edit:
I've done some more testing, and this appears to be an error occurring only within the Windows Presentation Foundation Designer windows within Visual Studio 2008 (with sp1). The project works fine, and no error is reported, provided I only use the XML editor. If I open this in the Designer, however, it reports the error and shows a Problem Loading designer.
The error does not appear unless the XAML file is opened in the VS designer.