tags:

views:

47

answers:

3

Hi everybody, I'm new to WPF so I've got a problem:

I need to create a grid. This grid should contain a column with a kind of thumbnails. When I move mouse over a thumbnail, there should appear a panel with a big image. This panel will cover all grid. But this will make thumbnail think that mouse already has gone. After mouse's gone, panel should dissappear. Mouse appears above thumb again, and panel appears. And again, and again. I don't know how to handle this. Could anybody suggest any solution?

A: 

Use MouseEnter and MouseLeave:

http://www.hanselman.com/blog/MouseEnterAndMouseLeaveLoopsInWPF.aspx

Aliostad
A: 

There are two ways I can think of to do this, depending on what kind of functionality you're looking for.

If you want the larger image to appear in proximity to the mouse and the thumbnail, then you might want to take a look at using a Tooltip.

Otherwise as Aliostad mentioned above, you could use the MouseEnter and MouseLeave events to trigger the display of whatever content is needed.

Val
+1  A: 

Sounds to me like you want to use IsHitTestVisible="False" on the image that pops up. This will make it ignore the popup when testing where the mouse is, so it will think your mouse is still over the thumbnail image. This should work on any UI element, except windows.

YotaXP
This is what I really needed, and it worked perfect for me! Thanks everybody!
oneTwoThree