Get a Usercontrol from a specific cell/column from grid
===

I have a grid withcolumns=3 and rows = 5. Each cell contains the same custom user control created at runtime. Each custom user control have a name and others properties differents.

So far so good....

When I try to get the object inside an specific cell I used (vb.net and WPF) this code:

Dim currentContainer As ObjectContainerControl = ContainerGrid.Children.Cast(Of UIElement)().OfType(Of ObjectContainerControl)().Where(Function(c) Grid.GetRow(c) = 0 And Grid.GetColumn(c) = 0)

Where "ObjectContainerControl" is my custom user control and container Grid is my grid'sname

This line send me the following error:

Unable to cast object of type 'WhereEnumerableIterator`1[MyProject.ObjectContainerControl]' to type 'My.ObjectContainerControl'.

How can i fix this???

Thanks all