Q: Specified element is already the logical child of another element. Disconnect it first Printing multiple pages from user control The visual v is  part of a grid section within a user control that I ma trying to print.  I am new to c# and am not entirely sure why I am getting this error. Could this be related to the xaml code?   
private void Print( Visual v )
        {
            var pd = new PrintDialog();
            var document = new FixedDocument();
            var fixedPage = new FixedPage();
            //System.Windows.FrameworkElement e = v as System.Windows.FrameworkElement;
            //if( e == null )



Transform originalScale = fixedPage.LayoutTransform;
                //get selected printer capabilities
System.Printing.PrintCapabilities capabilities = pd.PrintQueue.GetPrintCapabilities( pd.PrintTicket );
System.Windows.Size sz = new System.Windows.Size( capabilities.PageImageableArea.ExtentWidth, capabilities.PageImageableArea.ExtentHeight );
fixedPage.Width = sz.Width;
fixedPage.Height = sz.Height;
// Add visual, measure/arrange page.
fixedPage.Children.Add((FrameworkElement)v);
fixedPage.Measure(sz);
fixedPage.LayoutTransform = new ScaleTransform( 0.2823293807641634 + 0.2498215560314061, 0.2823293807641634 + 0.2498215560314061 );
fixedPage.Arrange( new System.Windows.Rect( new System.Windows.Point( capabilities.PageImageableArea.OriginWidth, capabilities.PageImageableArea.OriginHeight ), sz ) );
fixedPage.UpdateLayout();
fixedPage.LayoutTransform = originalScale;
//var pageContent = new PageContent();
//((IAddChild)pageContent).AddChild(internalPage);
//document.Pages.Add(pageContent);


pd.PrintDocument(document.DocumentPaginator, "My Document");

            }


A: Essentially this error states that ui element is already used and cannot be used in another structure - it can only have one parent. What I gathered form your question you are trying to do just that display and print the same visual element.
Your options are:


*

*List item as stated in error message remove control from view where it is displayed and 
print it

*create new instance of that visual element for printing
I suggest the second option even knowing it can be more work to set it up.
