user4477748
user4477748

Reputation:

i:Interaction.Triggers is not working in Windows Phone8.1

I added

xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 

namespace but it is showing error.

<i:Interaction.Triggers>   
    <i:EventTrigger EventName="MouseEnter">
        <i:InvokeCommandAction Command="{Binding MouseEnter}" />
    </i:EventTrigger>
</i:Interaction.Triggers>

Upvotes: 2

Views: 440

Answers (2)

lisp
lisp

Reputation: 4198

There simply is no MouseEnter event, when there's no mouse cursor. You'll have to use some other event to trigger your command.

Upvotes: 2

aloisdg
aloisdg

Reputation: 23521

In WP8.1 you should use this :

 <interactivity:Interaction.Behaviors>
    <core:EventTriggerBehavior EventName="Loaded">
        <core:InvokeCommandAction Command="{Binding PageLoaded}" />
    </core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>

with

xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:core="using:Microsoft.Xaml.Interactions.Core"

You can find missing dll here :

  • On right click "Add Reference"
  • Open Windows 8.1 or WindowsPhone 8.1
  • Open Extensions
  • Select Behaviors SDK (XAML)

Upvotes: 2

Related Questions