Sizing and Positioning Floating Window

Docking/MDI for WPF Forum

Posted 10 years ago by Randall Gouge
Version: 14.1.0600
Avatar

I am trying to position a floating window relative to the window containing the DockSite Control ... i.e. center it.  Do you have any examples showing how to accomplish this.

 

Thanks

Comments (4)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Randall,

Sorry we don't have any samples for that sort of thing.  That being said, if you know the screen bounds of your main window, and you know the size of the tool window that you want to float, you just would use this API to float it:

toolWindow.Float(position, size);

The "size" parameter would be your target floating tool window size, and the "position" parameter would need to be the screen position, which you can offset from the main window's position based on the size differences.


Actipro Software Support

Posted 10 years ago by Randall Gouge
Avatar

That works ... Thanx.  

A couple of things.  When there are multiple monitors it there a way to specify which monitor the floating window should open in ... also ... would be nice if the default size of the window was the size specified in the xaml ... not requiring the viewmodel thats opening the window to know about the size that the view should open in.

Posted 10 years ago by Randall Gouge
Avatar

I had another question ... I have the floating window open but do not want to allow it to attach/dock ... I'm currently using Tabbed MDI.  Is this possible?

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Randall,

I would imagine that you would need to offset the position by the size of your primary monitor to get it showing on another monitor.  You might be able to get the default size via the DockSite.GetControlSize(toolWindow) method that gets the related attached property value.

Our product has a ton of capability options for docking windows.  Check out the "Docking Window Capabilities" topic in the documentation for a full list of them, including ones that you are looking for.


Actipro Software Support

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.