Results 1 to 5 of 5

Thread: [RESOLVED] BlockUIContainer from a control VB.NET 2010

  1. #1

    Thread Starter
    Fanatic Member Megalith's Avatar
    Join Date
    Oct 2006
    Location
    Secret location in the UK
    Posts
    879

    Resolved [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:
    1. Private Function GraphicsPage() As BlockUIContainer
    2.         Dim uiCont As New BlockUIContainer()
    3.         Dim g as new grid = grdDiamond
    4.         uiCont.Child = g
    5.         Return uiCont
    6.     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
    If debugging is the process of removing bugs, then programming must be the process of putting them in.

  2. #2
    Hyperactive Member Arrow_Raider's Avatar
    Join Date
    Dec 2001
    Location
    AVR Lovers Club
    Posts
    423

    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.
    My monkey wearing the fedora points and laughs at you.

  3. #3

    Thread Starter
    Fanatic Member Megalith's Avatar
    Join Date
    Oct 2006
    Location
    Secret location in the UK
    Posts
    879

    Re: BlockUIContainer from a control VB.NET 2010

    thanks arrow raider, will get that implemented... another major revision lol
    If debugging is the process of removing bugs, then programming must be the process of putting them in.

  4. #4
    Hyperactive Member Arrow_Raider's Avatar
    Join Date
    Dec 2001
    Location
    AVR Lovers Club
    Posts
    423

    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.
    My monkey wearing the fedora points and laughs at you.

  5. #5

    Thread Starter
    Fanatic Member Megalith's Avatar
    Join Date
    Oct 2006
    Location
    Secret location in the UK
    Posts
    879

    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.
    If debugging is the process of removing bugs, then programming must be the process of putting them in.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width