XAML / C# : for each border -
in xaml / c# use lot of similar borders. named border1, border2, ..., border10. @ moment databinding looks this:
border01.datacontext = myobjectlist[0]; border02.datacontext = myobjectlist[1]; ... border10.datacontext = myobjectlist[9];
that quite ugly. how loop through borders?
how -for example- edit every border opacity in 1 loop?
thx, sid
@highcore in commentary gave recommendation, should consider use itemscontrol
, host each border, , items source itemscontrol
list of objects myobjectlist
.
i don't know trying do, answer on question i'd recommend use findname method, can use like:
for (int = 0; <= myobjectlist.length; i++) { border border = this.findname("border{0:00}", + 1); border.opacity = 0.5d; }
Comments
Post a Comment