pm

pm

  • NA
  • 109
  • 77.8k

Specified element is already the logical child of another

Jan 10 2013 6:36 AM
Hello, can anyone help?

I get this error "Specified element is already the logical child of another element. Disconnect it first." form this code

Code Snippet
 
                    txtPhaseNo.Text = customImage[i].PhaseNo.ToString();
                    txtPhaseNo.Foreground = System.Windows.Media.Brushes.Red;
                    txtPhaseNo.HorizontalAlignment = HorizontalAlignment.Center;
                    txtPhaseNo.VerticalAlignment = VerticalAlignment.Center;
                    grid.Children.Add(txtPhaseNo);
                    grid.Children.Add(customImage[i]);
                    containerCanvas.Children.Add(grid);