c# - how to access controls in listview datatemplate in windows phone 8.1 -
i need access grid in list-view data-template, when using code program reaches foreach loop , don't execute it
foreach (grid firstgrid in active_list.items) { var item = active_list.itemcontainergenerator.containerfromitem(firstgrid); var ch = allchildren(item); var tag = url; var control = (grid)ch.first(c => c.tag == tag); if (firstgrid.gettype() == typeof(grid)) { if ((string)firstgrid.tag == url) { foreach (progressbar prg in firstgrid.children) { if (prg.gettype() == typeof(progressbar)) { prg.isindeterminate = false; } } foreach (textblock txt in firstgrid.children) { if (txt.gettype() == typeof(textblock)) { txt.visibility = visibility.visible; } } } } }
this code active_list.items
won't give control actual data. if want access specific control in list view, need go through visual tree , find manually. think it's not practice manually change controls inside list view...
but if want way recommend check out topic similar question: how access specific item in listbox datatemplate?
Comments
Post a Comment