[RESOLVED] BlockUIContainer from a control VB.NET 2010
Hi all.
I have an existing flow document and onto it i wish to copy the contents of Grid into it. When i try i get the following error:-
"Specified element is already the logical child of another element. Disconnect it first."
Here is the function i am using which fails.
vb.net Code:
Private Function GraphicsPage() As BlockUIContainer
Dim uiCont As New BlockUIContainer()
Dim g as new grid = grdDiamond
uiCont.Child = g
Return uiCont
End Function
How would i disconnect the element? will i still be able to view the initial controls contents after it is disconnected? I have tried (fruitlessly) iterating the contents of the grid with a for each loop but the same error is reached on runtime when uiCont.Child is reached
Re: BlockUIContainer from a control VB.NET 2010
An instance of a control cannot have multiple parents. You should make a UserControl that has the elements you wish to copy. Use bindings to hookup to backing data. Then you can create multiple instances of your control, and they will show the same information if they have the same DataContext.
Re: BlockUIContainer from a control VB.NET 2010
thanks arrow raider, will get that implemented... another major revision lol :)
Re: BlockUIContainer from a control VB.NET 2010
Alright, let me know if you run need any specific guidance; I just gave a brief overview of the approach to take.
Re: BlockUIContainer from a control VB.NET 2010
Got it working. trying to bind all controls but have a new issue regarding xaml with bound data. I will create a new thread for this.