Home Forums WPF controls Xceed Toolkit Plus for WPF Change size of LayoutDocumentPane programatically

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • dougt@protocolinsight.com
    Participant
    Post count: 2
    #43571 |

    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?

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Doug,

    In both cases, you would want to set an initial size, and then change that size as needed.

    GridSplitter:

       // 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.

    Floating Windows:

       // 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;
    

    To set a specific height for the floatingWindow.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.