Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Drilling through a ListView

$
0
0

Hi,

I have ListView with the ItemSelected event attached to it. The event fires and in my receiver I obtain the selected ListView item.

The data template contains the following structure

StackLayout (Horizontal) -> Image (width set to about 1/5 the screen) : StackLayout (Vertical) -> 3 Labels

What I'm trying to do is drill down through the template to find the image and extract from that the StyleId.

If I was using native iOS, I could do something like

string data  = string.Empty;
foreach(var sv in View.Subviews)
{ 
    if (sv is UIImage)
    {
         var img = sv as UIImage;
         data = img.AccessabilityLabel;
    }
}

if (!string.IsNullOrEmpty(data))
// do something

Is there a way to do this using XF?

Paul


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>