Question

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

Was it helpful?

Solution 5

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

OTHER TIPS

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>

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.

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.

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.

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top