Wednesday, 11 September 2013

Windows Phone change text of textblock in listbox

Windows Phone change text of textblock in listbox

I have a listbox in my xaml page in my windows phone app.
the itemsource of the listbox is set to data coming from the server.
I need to set the text of a textblock/button inside this listbox according
to data received from the server.
I cant bind the data directly, neither can I change the data coming from
the server.
I need to do something like this:-
if (Data from server == "Hey this is free")
{ Set textblock/button text to free }
else
{ Set textblock/button text to Not Free/Buy }
data from server (for this particular element) can have more than 2-3
types, for example it can be $5, $10, $15, Free or anything else
so only in case of free, I need to set text to free otherwise set it to
Not Free/Buy.
How can I access this textblock/button inside the listbox?

No comments:

Post a Comment