Hi,
I have a custom creation filter on ultralistview to load image on demand. when item is fully visible its image will load.,
it works good but in thumbnail view if just 1 px of item is out of scope it does not load image.
is there any way to determine partially viewed items or one more line before and one more line after from viewed items at least.
here a part of my custom creation filter...
Public Sub AfterCreateChildElements(parent As UIElement) Implements IUIElementCreationFilter.AfterCreateChildElements
If TypeOf parent Is UltraListViewItemUIElement Then
Dim item As UltraListViewItemUIElement = DirectCast(parent, UltraListViewItemUIElement)
If item.Item.Appearance.Image Is Nothing AndAlso item.IsFullyVisible Then
item.Item.Appearance.Image = Me.GetThumbnail(item.Item.SubItems("FilePath").Value.ToString())
End If
End Sub
Public Function BeforeCreateChildElements(parent As UIElement) As Boolean Implements IUIElementCreationFilter.BeforeCreateChildElements
Return False
End Function
Hello Abdurrahmanoguz,
Yes, you can achieve this. Each item UIElement is nested in UltraListViewItemContainerUIElement. One possible solution could be to check the rectangle of item UIElement against the one of the container UIElement. You can use code like this:
Dim containerElement = item.ParentDim margin As Integer = 1Dim isTopCut = containerElement.Rect.Top - item.Rect.Top < marginDim isLeftCut = containerElement.Rect.Left - item.Rect.Left < marginDim isRightCut = containerElement.Rect.Right - item.Rect.Right < marginDim isBottomCut = containerElement.Rect.Bottom - item.Rect.Bottom < marginDim isFullyVisible = isTopCut OrElse isLeftCut OrElse isRightCut OrElse isBottomCut
Please let me know if you have any additional questions.
thanks your attention but containerElement contains all element so its rectangle bigger than visible part of screen like 700x2200 or may be bigger. my viewed area is 700x500 or like that.