This is a migrated thread and some comments may be shown as answers.

setFloatingLocation() method

1 Answer 92 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Achim
Top achievements
Rank 1
Achim asked on 26 Aug 2013, 09:10 AM
Hey there,

I have a question about the setFloatingLocation() - method. I want to use it to place a floating pane in the middle of the main window of my app, also after the user has resized the main window. The method works fine for the first time I open the floating pane, but when i close the floating pane, resize the main window and then open the floating pane again, it re-opens at the same position it was before. Whay does the setFloatingLocation(pane, setPosition()); not work?

public void OnNewCbs(RadDocking dockingManager)
        {
            RadPane pane = GetPane(dockingManager.Panes, "NewEditCbs");
            if (pane != null)
            {
                RadDocking.SetFloatingLocation(pane, setPosition());
                pane.IsHidden = false;
            }
            else
            {
                pane = new RadPane();
                pane.Header = "New CBS/ Edit current CBS";
                pane.Name = "NewEditCbs";
                Frame frame = new Frame();
                frame.Content = new CbsNewAndEditView();
                pane.Content = frame;
                pane.CanDockInDocumentHost = false;
                ((RadPaneGroup)((RadSplitContainer)dockingManager.DocumentHost).Items[0]).AddItem(pane, DockPosition.Center);
                RadDocking.SetFloatingSize(pane, new Size(470, 740));               
                RadDocking.SetFloatingLocation(pane, setPosition());
                pane.MakeFloatingOnly();
            }
        }
 
        private Point setPosition()
        {
            Double x = ((App)App.Current).MainWindow.Left + (((App)App.Current).MainWindow.ActualWidth / 2.0 - 470.0 / 2.0);
            Double y = ((App)App.Current).MainWindow.Top + (((App)App.Current).MainWindow.ActualHeight / 2.0 - 740.0 / 2.0);
            Point p = new Point(x,y);
            return p;
        }

Thank you for your help!

Regards,
Achim

1 Answer, 1 is accepted

Sort by
0
George
Telerik team
answered on 28 Aug 2013, 03:19 PM
Hi Achim,

The FloatingLocation defines the exact position where the floating pane will be shown (it's not relative to the docking control. Could you share with us what do you expect in this scenario? What is the expected and the real behavior?

I am glad to assist you further.

Regards,
George
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
Docking
Asked by
Achim
Top achievements
Rank 1
Answers by
George
Telerik team
Share this question
or