vb.net - Cast(Of ?) from UIElement -
in silverlight custom controls in theuielementcollection
of stackpanel
. want list of them specific value. there divelements
in container. returns nothing
when know have 1 or more. know can make simple loop , cast types inline, want better linq
, cast(of tresult)
. attempt @ casting:
dim mylist = trycast(spdivs.children.where(function(o) directcast(o, divelement).elementparent bcomm).cast(of divelement)(), list(of divelement))
the problem can't cast list(of divelement)
. collection uielementcollection
, not list(of t)
.
you build new list, though. can simplified using oftype
instead of casting manually:
dim mylist = spdivs.children.oftype(of divelement)() .where(function(o) o.elementparent bcomm) .tolist()
Comments
Post a Comment