EventSetter - error XAML in Visual Studio designer
- by pileggi
Hi!
I've done my TreeView all with XAML but now I'd like to manage an event with code-behind. The HierarchicalDataTemplate contains an Image. I need to capture the events MouseEnter / MouseLeave on the Image. I've tried in this way:
<Image x:Name="imgArticolo" Source="{Binding imgArt}">
<Image.Style>
<Style TargetType="{x:Type Image}">
<EventSetter Event="MouseEnter" Handler="iArt_MouseEnter"/>
</Style>
</Image.Style>
</Image>
But in the designer of Visual Studio appear the error: "Impossible to load a file XAML with EventSetter".
How can I remedy?
Thank you!
Pileggi