EventSetter - error XAML in Visual Studio designer

Posted by pileggi on Stack Overflow See other posts from Stack Overflow or by pileggi
Published on 2010-06-08T08:24:47Z Indexed on 2010/06/08 8:52 UTC
Read the original article Hit count: 269

Filed under:
|
|
|

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

© Stack Overflow or respective owner

Related posts about .NET

Related posts about wpf