6

When I open up a XAML project, the Error list will report issues with all behaviors on each page I have open. Examples of the are:

The name "EventTriggerBehavior" does not exist in the namespace "using:Microsoft.Xaml.Interactions.Core"
The name "Interaction" does not exist in the namespace "using:Microsoft.Xaml.Interactivity"

But I do have and confirmed the reference to BehaviorsXamlSDKManaged and the project does compile and run fine.

enter image description here

If I open up Blend, by either right clicking the solution explorer or opening it in windows explorer - Blend will report back the same errors and when I go to the Asset List - the behaviors will be blank

Blank Asset List

If I create a Javascript version, all behaviors are found.

I am stumped after spending a few days on this, any assistance would be greatly appreciated.

---- EDIT: I tried reinstalling VS2013

Dave Friedel
  • 1,028
  • 1
  • 14
  • 20

6 Answers6

2

I resolved the error by adding a reference to XAML Behaviors for both my Phone and Windows projects: Add Reference -> Windows 8.1 -> Extensions -> Behaviors SDK (XAML). Microsoft.Xaml.Interactivity.Interaction is not included in the Windows 8.1 or Windows Phone 8.1 Core.

<Page
x:Class="App1.BlankPage1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App1"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:i="using:Microsoft.Xaml.Interactivity"
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
mc:Ignorable="d">

<Page.Resources>
    <local:ItemClickedConverter x:Key="ItemClickedConverter" />
</Page.Resources>

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <GridView>
        <i:Interaction.Behaviors>
            <core:EventTriggerBehavior EventName="ItemClick">
                <core:InvokeCommandAction 
                    Command="{Binding GoToContentCommand}" 
                    InputConverter="{StaticResource ItemClickedConverter}">
                </core:InvokeCommandAction>
            </core:EventTriggerBehavior>
        </i:Interaction.Behaviors>
    </GridView>
</Grid>

Nelson
  • 31
  • 5
  • As you can see from the screenshot - it already has that done. I am talking with Microsoft currently - they acknowledge it is some issue that is currently unknown but we are using debugdiag to identify it. I will report my results once it is found. – Dave Friedel May 22 '14 at 17:30
  • I'm using version 12.0.0.0 and it's labeled Behaviors SDK (XAML) vs BehaviorsXamlSDKManaged. I thought by readding yours, it might upgrade to the correct version. I'll check back if mine breaks. Please follow up in this thread if you hear anything from Microsoft! Thanks. – Nelson May 22 '14 at 18:39
  • Microsoft was unable to identify the issue but after updating to Visual Studio Update 2 - the issue was resolved. – Dave Friedel May 29 '14 at 14:10
1

How I resolved it:

  • I uninstalled yet again
  • Removed any extra apps that were related to VS2013 (addins, libraries, Xamarin, etc)
  • Rebooted
  • Ran registry cleaner
  • Rebooted

Then re-installed with default options.

For good measure, I considered sacrificing a cow to the programming gods but elected to make them a strong pot of coffee.

Hope this helps someone else.

----- Updated details around Ran registry cleaner

I used the free version of Wise Registry Cleaner http://www.wisecleaner.com/wiseregistrycleanerfree.html

It found numerous issues around the components and a few in the Uninstaller. I often find the more elaborate applications leave old registry settings which make the re-install not accurately reflect a fresh installation.

Dave Friedel
  • 1,028
  • 1
  • 14
  • 20
1

Please make sure that your project has a reference set for the Xaml Behaviors assembly. Right click on your project -> add -> reference. Check under Windows Phone 8.1 (or Assemblies) -> Extensions and check Behaviors SDK (XAML). I hope this helps.

paleglow
  • 23
  • 6
  • I had done this - this appears to be something with the IDE. See the first screenshot - it shows the assemblies referenced. – Dave Friedel Aug 06 '14 at 15:11
0

Make sure your project is targeting the 4.0 or 4.5 framework. If you target the 3.5 framework the behaviors will not be shown.

Pale Ale
  • 478
  • 7
  • 11
  • I was developing Windows 8.1 Store apps - so the framework was set to 4.5.1, so the change was not preventing the display for me but if it resolved your issue - great catch. – Dave Friedel Mar 20 '14 at 18:19
0

After updating to Visual Studio Update 2 - the issue was resolved.

Dave Friedel
  • 1,028
  • 1
  • 14
  • 20
0

I had a similar problem with a project in Blend 2015. The behaviours reappeared after adding these references (from Assemblies/Extensions)

  • Microsoft.Expression.Interactions
  • Microsoft.Expression.Prototyping.Interactivity
  • System.Windows.Interactivity
NeilMacMullen
  • 3,339
  • 2
  • 20
  • 22