I have an ActiveX control, which is an XML Editor (XMetal XMax). I have included this as a COM component (WindowsFormsHost) in my WPF project. The editor's content model, such as XML Schema, CSS, XML elements, XML attributes, etc., are pre-configured by an XMetal Developer utility, and assigned to the XML editor in the WPF implementation as a single file with the suffix ".xac".
Step 1 - Works: When I add the XML Editor to a grid (this.grid1.Children.Add (host)), everything works great. The XML Editor and all XML content is displayed.
Now I go one step further and have integrated XCeed AvalonDock as a layout base.
Step 2 - Does Not Work: The prerequisites are the same as in step 1. If I assign the XML Editor to the "x: Name" property of an "xcad: LayoutDocument", I get an error message. Although the symbol of the XML Editor is visible in the "xcad: LayoutDocument", the XML basic configuration .xac file will not be loaded. An error message appears.
As I said, when assigning to a Grid.Row everything works fine. I have tried a lot, but unfortunately without success. Can someone give me some help please. Many Thanks.
public partial class MainWindow : Window
{
public AxXMetaLControlLib.AxXMetaLControl axXmax;
System.Windows.Forms.Integration.WindowsFormsHost host;
public MainWindow()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
// Create the interop host control.
host = new System.Windows.Forms.Integration.WindowsFormsHost();
// Create the ActiveX control.
axXmax = new AxXMetaLControlLib.AxXMetaLControl();
// Assign the ActiveX control as the host control's child.
host.Child = axXmax;
// Add the interop host control to the Grid
// control's collection of child controls.
this.XMaxControl.Content = host;
//this.grid1.Children.Add(host);
// Load an XML File into XMAX
axXmax.LoadFromFile("C:/Users/Administrator/Desktop/VS_XMax_PiMod/XMax_PiMod_01/instance1.xml", "C:/001_Mein/001_CMS_Projekt/01_Mein_Projekt/01_Finale/wCMS_02/XMax_Dateien/pi-mod.xac", XMetaLControlLib.SQDocViewType.sqViewTagsOn);
}
}
<Grid x:Name="grid1">
<StackPanel>
<xcad:DockingManager>
<xcad:LayoutRoot>
<xcad:LayoutPanel Orientation="Vertical">
<xcad:LayoutPanel Orientation="Horizontal"
DockHeight="*">
<xcad:LayoutAnchorablePaneGroup DockWidth="150"
Orientation="Vertical">
<xcad:LayoutAnchorablePane DockHeight="100">
<xcad:LayoutAnchorable x:Name="myXmax" Title="Tool 1">
</xcad:LayoutAnchorable>
</xcad:LayoutAnchorablePane>
<xcad:LayoutAnchorablePane DockHeight="70">
<xcad:LayoutAnchorable Title="Tool 2">
<TextBox />
</xcad:LayoutAnchorable>
</xcad:LayoutAnchorablePane>
</xcad:LayoutAnchorablePaneGroup>
<xcad:LayoutDocumentPaneGroup>
<xcad:LayoutDocumentPane>
<xcad:LayoutDocument x:Name="XMaxControl" Title="Doc1">
</xcad:LayoutDocument>
<xcad:LayoutDocument Title="Doc2">
<TextBox />
</xcad:LayoutDocument>
</xcad:LayoutDocumentPane>
</xcad:LayoutDocumentPaneGroup>
<xcad:LayoutAnchorablePaneGroup DockWidth="250"
Orientation="Vertical">
<xcad:LayoutAnchorablePane>
<xcad:LayoutAnchorable Title="Attribute Manager">
<xctk:PropertyGrid x:Name="propertyGrid" SelectedObject="{Binding}" >
</xctk:PropertyGrid>
</xcad:LayoutAnchorable>
</xcad:LayoutAnchorablePane>
</xcad:LayoutAnchorablePaneGroup>
</xcad:LayoutPanel>
<xcad:LayoutAnchorablePaneGroup DockHeight="150">
<xcad:LayoutAnchorablePane>
<xcad:LayoutAnchorable x:Name="prop" Title="Tool 4">
</xcad:LayoutAnchorable>
</xcad:LayoutAnchorablePane>
</xcad:LayoutAnchorablePaneGroup>
</xcad:LayoutPanel>
</xcad:LayoutRoot>
</xcad:DockingManager>
</StackPanel>
</Grid>