Hello,
Here is my problem :
I have a XamDockManager with one SplitPane. The SplitPane contains one ContentPane.
In the ContentPane, I have one TextBox.
If I put the XamDockManager in the ElementHost of a WinForm application : it's impossible to write in the TextBox, only if the ContentPane is in Floating mode (the space button and the backspace button are the only one to work)
If the ContentPane is in a Dockable location (left/right/bottom/up), it works fine.
If I put the XamDockManager directly in a WPF page or window, it works fine, even in Floating mode.
Is it an known issue ? Is there a way to make it work ?
I'm using Infragistics For WPF 10.3.
If i'm not clear enough, i can send you the "very simple" source code of my application.
Thank you.
Ok, it works fine !
As you said, I hooked the Loaded event of the ToolWindow and used the ElementHost EnabledModelessKeyboardInterop method on the RoutedEvent source.
Here is the code if anybody has the same problem :
void xamDockManager1_ToolWindowLoaded(object sender, Infragistics.Windows.DockManager.Events.PaneToolWindowEventArgs e) {
e.Window.Loaded += new RoutedEventHandler(Window_Loaded);
}
void Window_Loaded(object sender, RoutedEventArgs e) {
Window window = Window.GetWindow((DependencyObject)e.Source);
ElementHost.EnableModelessKeyboardInterop(window);
(Sorry, didn't find the "Insert code style" button on your reply form)
Thank you for your help Andrew, this problem was driving me crazy !
That method is present in 10.3 - just in one of the SRs so if you download the latest SR then you would have that method. Alternatively you could try hooking the Loaded of the ToolWindow handed to that event and from the Loaded event using the Window.GetWindow method to get the window and call that method on ElementHost.
Thank you for your reply.
But it seems that the EnabledModelessKeyboardInterop method defined the namespace System.Windows.Forms.Integration.ElementHost can only deal with WPF Window opened by a Winform.
In my case, I have a WPF UserControl (which contains the xamlDockManager) in an ElementHost in a WInForm.
I tried to use the EnabledModelessKeyboardInterop method directly in the xamDockManager1_ToolWindowLoaded event, using the e.Window as parameter but the PaneToolWindow can't be converted to a System.Window.
It looks like the Infragistics.Windows.Utilities.EnableModelessKeyboardInterop could solve my problem but the method is not here in Infragistics 10.3. (Probably implemented in Infragistics 11.x)
Am I doing something wrong or is there another way around ?
Thank you in advance
When using WPF Windows within a non-WPF application one needs to invoke the EnableModelessKeyboardInterop method defined by the ElementHost class. Since we are creating a WPF Window to host the floating content that method needs to be call. Since we create the Window, we can call that for you but we will only do that if you call the static Infragistics.Windows.Utilities.EnableModelessKeyboardInterop (e.g. in the static ctor of your app or form).