Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
460
How do you add a floating pane in the code behind
posted

I Have the follwoing code in codebehind to add a pane.  How do I get the position to be a flyout.

 

SplitPane sp = new SplitPane();

sp.Name = chatUser;

ContentPane cp = new ContentPane();

cp.Width = 300;

cp.Header =
"Chat";

cp.Height = 300;

ChatWindow cw = new ChatWindow();

cp.Content = cw;

xamDockManagerMain.Panes.Add(sp);

cp.Activate();

Parents
No Data
Reply
  • 54937
    Offline posted

    Floating or in a flyout? In any case its the same way you would do it in xaml. For floating, you have to set the InitialLocation attached property of the xamDockManager on the SplitPane to DockableFloating before adding it to the Panes collection. This is how you would set the Split to be docked to the left, right, top, bottom, floating only or floating dockable. For flyout (i.e. unpinned), you would set the IsPinned property of the ContentPane to false. Note, you should not be setting the Width/Height of the ContentPane. If you do that the CP will always be that size (since that's what setting the Width/Height of an element does in WPF) even if the containing element is resized larger/smaller. If you want to initialize the size of the splitpane then set its Width (assuming its docked left/right or top if its docked bottom/top).

Children
No Data