IsLiveSplittingEnabled=False not working well when control is hosted inside MFC

Docking/MDI for WPF Forum

The latest build of this product (v25.1.1) was released 4 months ago, which was before this thread was created.
Posted 2 months ago by Daniel Constantin - ModuleWorks GmbH
Version: 25.1.1
Avatar

Hi!

I have a WPF custom control which contains a docking:DockSite with many tool windows.

This control can be hosted inside other WPF Apps or MFC Apps on top of other WPF or MFC controls.

When I host it on top of MFC controls the IsLiveSplittingEnabled=False, the place where the new position will be (adorner or whatever control is that one which moves on the dock site) is a bit off like the docksite does not know its position inside the MFC control.

Is there a way to improve this behavior such that the adorner or whatever control is that preview positioning control is that?

Kind regards,

Daniel

Comments (4)

Posted 2 months ago by Daniel Constantin - ModuleWorks GmbH
Avatar

Hi!

I noticed that when UseHostedPopups="True" the ghost slider has no offset so it is working correctly but then I cannot see the ghost slider when is above the WinFormsHost control.

The same problem seem to appear also when hovering the headers of hidden tool windows. The tool windows does not appear on top of the dock site, like the windows does not know the coordinates on screen of the dock site.

Kind regards,

Daniel

[Modified 2 months ago]

Posted 2 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

I assume you have UseHostedPopups="False" set.

While we fully test our WPF controls in WPF-based applications, we don't normally test them in various interop scenarios like in MFC apps. If you'd like us to take a look, please make a new simple sample project that shows it happening and send that to our support address. Reference this thread in your email and be sure to exclude the bin/obj folders so it doesn't get spam blocked.

When live splitting is off and not using hosted popups, we internally create an adornment WPF Window to host things like splitters. We get the target WPF element and call PointToScreen to get screen coordinates of it. Then we position the host Window over the screen bounds. From what you are describing, it sounds like something with that bounds-determination logic isn't working properly.

If it's due to PointToScreen not returning correct results, then there wouldn't be much we could do since it's a core Microsoft API. Or are you thinking the offset of the adorner is the same amount from your MFC window's client bounds top-left down to the top-left corner of the root WPF control in your app?

What you described in the followup would make sense since when UseHostedPopups="True", the slider, dock guides, etc. are rendered in the same WPF Window as the DockSite.  But if you have interop controls in that Window, you run into the annoying "airspace" issue in WPF where interop content always renders on top of WPF content.

Since the problem only happens with UseHostedPopups="False", it must be due to something throwing off the positioning of the adornment WPF Window we create to host things like splitters, specifically to work around WPF's airspace issue.  That transparent adornment WPF Window is separate from the main application WPF Window, and that's where a positioning issue must be occurring.


Actipro Software Support

Posted 2 months ago by Daniel Constantin - ModuleWorks GmbH
Avatar

Hi!

Yes, I have UseHostedPopups="False" and IsLiveSplittingEnabled="False".

I think the same, that the adornment layer is above the entire MFC window and not just only above the WPF dockSite control causing these positioning issues.

I will create a sample for this.

Thank you!

Daniel

Posted 1 month ago by Daniel Constantin - ModuleWorks GmbH
Avatar

Hi!

It seems that on the next version (25.1.2) this will be fixed.

Kind regards,

Daniel

Add Comment

Please log in to a validated account to post comments.