Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Behaviors missing in Blend and VS2013 for XAML project but present in Javascript project

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

like image 664
Dave Friedel Avatar asked Feb 20 '14 16:02

Dave Friedel


2 Answers

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>

like image 92
Nelson Avatar answered Oct 14 '22 22:10

Nelson


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.

like image 41
Dave Friedel Avatar answered Oct 14 '22 22:10

Dave Friedel