I am working with the exceed Avalon Dock. When the user re-sizes a LayoutDocumentPane (either via a gridsplitter when docked or the window when floating). I need to adjust the size of the Pane by a certain number of pixels that is determined in the code (I have a grid and I want to display only whole rows/no partial rows). Is there a way to change the size of the LayoutDocumentPane programatically?
In both cases, you would want to set an initial size, and then change that size as needed.
// Set the initial height of the dock
_pane1.DockHeight = new GridLength( 100, GridUnitType.Pixel );
_pane2.DockHeight = new GridLength( 400, GridUnitType.Pixel );
// where _pane1 and _pane2 are the LayoutDocumentPanes
You would then do this after a GridSplitter movement, to force the size as needed.
// Set the initial size of the window
_doc1.FloatingWidth = 300;
_doc1.FloatingHeight = 300;
// prior to floating so that when the LayoutDocument will start floating, its floatingWindow size will have specific values.
Then, when the floatingWindow size is changed, you could do something like this:
var w = _dockingManager.FloatingWindows.FirstOrDefault();
if( w != null )
w.Height = 300;