views:

36

answers:

3

ListViewItem Contain one thumbnail,

when the mouse over the thumbnail,I want to show a big Image,

the center should equal between thumbnail and big image,

any suggestion?

sorry about my poor English, there is a photo about my idea, maybe you can see what I said: http://farm5.static.flickr.com/4100/4788840950_7d952a384c_b.jpg

A: 

You should to implement a FlyWeight pattern described in details in Judith Bishop book C# 3.0 Design Patterns by O'REILLY publishing. Once you implement FlyWeight presentation, the other work will be simple. You then just have to on mouse hover event in DataTemplate raise to show your FullSize image.

Eugene Cheverda
+1  A: 

You can put the big image inside the list view item (in a grid for example) and use RenderTransform to scale the big image to full size without changing the layout of the list view.

Or, if you want to do the work yourself, use Visual.TransformToDescendant or Visual.TransformToAncestor

Nir
A: 

Im sorry, I dont quite understand the question, but you can get the transform used to position the thumbnail against any visual ancestor via the method

var transform = thumbnail.TransformToAncestor(AnyAncestorControl);

then you can use that transform, call the Transform() method to get the bounds relative to the AnyAncestorControl (which is usually your root of your page/control) and use that bounds variable to position your new larger image.

HTH

Mark