In silverlight my custom controls are in theUIElementCollection
of my StackPanel
. I want to get a list of them by a specific value. There only DivElements
in the container. It returns Nothing
when I know I have one or more. I know I can make a simple loop and cast types inline, but I want to get better with LINQ
and Cast(Of TResult)
. My attempt at casting:
Dim myList = TryCast(spDivs.Children.Where(Function(o) DirectCast(o, DivElement).ElementParent Is bComm).Cast(Of DivElement)(), List(Of DivElement))