This project has moved and is read-only. For the latest updates, please go here.

how to add new layout document from code

Dec 18, 2013 at 2:51 PM
I am working in an project (wpf project, but in the powerbuilder ide) and just now I have a issue with open a new layout document from my application menu. The question is how can i open dinamically 'n' new documents in my window using AvalonDock 2.0.

Note: I am working with fixed layouts documents and it is correct, but I need add new documents dinamically

How do it?

Sorry by my bad english
Dec 18, 2013 at 6:25 PM

Can you give an x:Name to your LayoutDocumentPane in xaml and add LayoutDocument to it ?
 private void Button_Click_1( object sender, RoutedEventArgs e )
      _layoutDocumentPane.Children.Add( new LayoutDocument() { Content = new TextBlock() { Text = "My Text"}, Title = "New Doc" } );
Dec 20, 2013 at 6:04 PM
Thanks, but the issue is that i am working in

i tried the code in c# and it is working fine but in powerbuilder no, because the Children.Add() function is not found, I found that layoutDocumentPane is traslated to PowerObject and so the application can not execute the add action.

in xaml, the _layoutDocumentPane is part of AvalonDock but in the code is PowerObject.

I am seeking for other solution.