Setting ToolWindow Position Using MVVM

Docking/MDI for WPF Forum

Posted 6 years ago by jess tsai
Version: 18.1.0675
Avatar

HI, 

I already knows Float() function can setting position and size. But I'm using MVVM model to create my program.  I don't know how can I calling Float() function under MVVM Model. So...is there any way can  pre-specified ToolWindow's floating Position, without directly calling Float() Function? Thanks for your help.

[Modified 6 years ago]

Comments (3)

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

Hello,

While you can't directly float a window with MVVM via a property, you can accomplish it another way without using Float().  When you first open a docking window, the DockSite.WindowDefaultLocationRequested event will fire.  So setting IsOpen on your VM will effectively trigger that event.  You could add a handler for that event that sets e.ShouldFloat = true and any other properties as appropriate.  You could determine whether to set that e.ShouldFloat based on a property on your VM.  The e.Window.DataContext should be your VM.

As far as location, it will float it centered over the dock site at this time.  I wonder if we should add an e.FloatLocation property to the DockingWindowDefaultLocationEventArgs that would default to null, but allow you to specify a default location if e.ShouldFloat was set.  Would that help?


Actipro Software Support

Posted 6 years ago by jess tsai
Avatar

Thanks for your reply. And Yes, if there has and FloatLocation property can specify window location, that will be very helpful.

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

Hello,

Ok we will add it for the next build.


Actipro Software Support

The latest build of this product (v24.1.3) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.