Click to See Complete Forum and Search --> : How to determine if Image inside Listbox is visible?


cebugdev
June 16th, 2009, 05:38 AM
Hi,

As the title asks; How to determine if Image inside Listbox is visible?

My listbox is binded to List<MyImageList> variable. MyImageList class contains an ImageSource(BitmapImage) and a string.

Somewhere in my application i want to check if the Image in the list item is visible in my listbox viewport to perform additional operation, the problem is i dont know how.

I found a tutorial on how to do this in ScrollViewer
but the problem is ImageSource and/or BitmapImage class does not have "TransformToAncestor" function.
The tutorial for doing this in scrollviewer is here: http://blogs.msdn.com/llobo/archive/2007/01/18/elements-visibility-inside-scrollviewer.aspx

Now how can i do this in Listbox with a listItem that contains an Image?

Arjay
June 16th, 2009, 05:05 PM
You can check the ListBoxItem.IsVisible property.