windows runtime - What's visible in a ScrollViewer? -


I have a GridView . I'm using nested ScorpViewer of SnapPoints to see each record because it is only a visible change, and there is no data change, how can I determine it Which record (current) are visible to me? Something like SelectedItem , but a visual query. I can check every record, but it seems disqualified. idea?

In your case, you can use the XTL Toolkit with VisualTreeHelperExtensions And do something like

  gridView .GetDescendantsOfType & lt; GridViewItem & gt; (). Select (gvi = & gt; gridView.ItemFromContainer (gvi));   

It does a somewhat intense visual tree search, but it can be fine for your scenario if your GridView uses virtualization because the item returns Have gone or are near view ports. If you want to be more precise then you can test to force reset intersections. Something can be sufficient:

  Fixed class rectExtensions {public static bool ContentsPartOf (This RET Bearerctact, Ricet Shortcut) {// It is a very small scrollable horizontally Targeted testing is. Return bigRect.Left & lt; Small diagonals Late End; BigRect.Right & gt; SmallRect.Left || BigRect.Left & lt; Small diagonals Write & amp; BigRect.Right & gt; SmallRect.Right; }} Var sv = gridView.GetFirstDescendantOfType & lt; ScrollViewer & gt; (); Var bigRect = New Rect (0, 0, sv.ActualWidth, sv.ActualHyight); Gridview .GetDescendantsOfType & lt; GridViewItem & gt; (). Where (live = & gt; bredected contents PARTOf (gvi.GetBoundingRect (sv)). Select (GV = & gt; GridviewEtemform CONTAINER (GVI));    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -