F # interface syntax

I have been translating C # code for multipage printing to F #. Can someone tell me how to translate:

((IAddChild)page1Content).AddChild(page1)

      

context:

       // printdia = printdialog
       // printdoc = printdocument

       // create a page
       let page1 = new System.Windows.Documents.FixedPage()
       page1.Width <- printdoc.DocumentPaginator.PageSize.Width
       page1.Height <- printdoc.DocumentPaginator.PageSize.Height
       page1.Children.Add(printcanvas) |> ignore
       // add the page to the document
       let page1Content = new System.Windows.Documents.PageContent()
 (*C#*)((IAddChild)page1Content).AddChild(page1)
       printdoc.Pages.Add(page1Content) |> ignore
       // and print
       printdia.PrintDocument(printdoc.DocumentPaginator, ordernr.Text);

      

C # source code

+3


source to share


1 answer


If it page1Content.AddChild(page1)

doesn't work, try it (page1Content :> IAddChild).AddChild(page1)

.



+5


source







All Articles