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

Get data object inside of a ViewCell

$
0
0

I'm creating a customized ViewCell. i.e:

public class ContributionItemCell : ViewCell

and I'm looking to change the value of a label based on the value of the item selected inside of the parent listview. i.e.:

    Label Amount;
        //This won't work, but this is what I am trying to figure out
        if (selectedItem.Value == 0) //This won't work, but this is what I am trying to figure out
        {
            Amount= new Label
            {
        "Value One"
            };
        }
    else
    {
    Amount= new Label
            {
        "Value Two"
            };
    }

I can't use BindingContext because the OnBindingContextChanged won't have fired yet.

Any thoughts? Thanks.


Viewing all articles
Browse latest Browse all 75885

Trending Articles



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