When hosting a Windows Forms Control inside a WPF DockSite window, the ActiveWindow (and also LastActiveXXXWindow) is not updated properly for floating windows.
Sample:
<Window x:Class="WpfApplication7.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:docking="http://schemas.actiprosoftware.com/winfx/xaml/docking"
xmlns:forms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
Title="MainWindow" Height="350" Width="525">
<docking:DockSite>
<docking:Workspace>
<docking:TabbedMdiHost>
<docking:TabbedMdiContainer>
<docking:DocumentWindow Title="Forms" CanRaft="True">
<WindowsFormsHost>
<forms:TextBox />
</WindowsFormsHost>
</docking:DocumentWindow>
<docking:DocumentWindow Title="WPF" CanRaft="True">
<TextBox />
</docking:DocumentWindow>
</docking:TabbedMdiContainer>
</docking:TabbedMdiHost>
</docking:Workspace>
</docking:DockSite>
</Window>
To reproduce:
- Start the application and attach Snoop, to check the actual values for ActiveWindow and LastActiveXXXWindow.
- Make the document window "Forms" floating.
- Now switch between the document window "WPF" within the main window and the floating window "Forms" and watch the ActiveWindow and LastActiveXXXWindow properties.
-> In both cases the ActiveWindow and LastActiveDocumentWindow is the "WPF"-window.
Is there a way to get those properties (and the associated events) work in this case?
Thanks in advance
Stefan