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

PRISM + Floating Dock

2 Answers 81 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Yonggu Kang
Top achievements
Rank 1
Iron
Yonggu Kang asked on 25 Jul 2011, 07:01 PM
Hi Telerik Team,

I have 2 questions for floating dock, forgive me not to separate with different thread.

1. Find existing Floating pane 
 I used following code to specific Radpane is existsed in shell,
 
myShell.ChildrenOfType<Telerik.Windows.Controls.RadPane>().Where(k => k.Name.Equals(viewName)).SingleOrDefault();
but can't get floating radpane. How can I get specific floating pane ?

2. pane.MakeFloatingDockable().
As mentioned here in some thread, I often used following code for dynamic float dock creation in prism region and
It worked well in Q1 in 2011, but in Q2 floating dock doesn't pop up any more without adding pane.MakeFloatingDockable().
Is this changed by design or something I missing ?

private void OpenIndiFloatDock(object view, ViewInfo info)
     {
         string regionId = GetFloatRegion(info.Width, info.Height);
         // get view
         RadPane pane = ShellHelper.GetRadPane(view, info);
 
         _regionManager.Regions[regionId].Add(pane, pane.Name);
         _regionManager.Regions[regionId].Activate(pane);
 
         // THIS IS ADDITIONALLY NEEDED IN Q2...BY DESIGN ?
         pane.MakeFloatingDockable();
     }
 
     public string GetFloatRegion(int width,int height)
     {
         string regionId = RegionNames.FloatRegion + Guid.NewGuid().ToString();
         RadSplitContainer container = new RadSplitContainer {InitialPosition = DockState.FloatingDockable };
         // set docking size and loc attached propery
         RadDocking.SetFloatingLocation(container, GetCurrentFloatPoint());
         RadDocking.SetFloatingSize(container, new Size(Math.Max(width,400),Math.Max(height,300)));
         // add group
         RadPaneGroup group = new RadPaneGroup();
         container.Items.Add(group);
         //add into manager
         RegionManager.SetRegionName(group, regionId);
         group.SetValue(RegionManager.RegionManagerProperty, _regionManager);
         this.shell.DockManager.Items.Add(container);
         return regionId;
     }

Thank you in advance.

Kang




2 Answers, 1 is accepted

Sort by
0
Accepted
George
Telerik team
answered on 28 Jul 2011, 09:45 AM
Hello Yong-Gu Kang, 


Straight to your questions:

1. The floating panes are not located in the shell, that's why you cannot find them using this approach. I would suggest using the following code:

this.dock.Panes.Where(p => p.IsFloating && !p.IsHidden && p.Name == "paneName").FirstOrDefault();

The RadDocking control keeps a collection of all panes(even the hidden ones) that are not disposed. You could use this collection (RadDocking.Panes) in order to find specific floating pane.

2. We are not aware of such breaking change in RadDocking control. I tried to reproduce the problem without PRISM but to no avail. Please, refer to the attached project and let me know if I am doing something wrong.

I am glad to assist you further.


Regards,
George
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Yonggu Kang
Top achievements
Rank 1
Iron
answered on 03 Aug 2011, 01:51 PM
Hi George,

Thank you for your kind reply.
I missed to use panel collection, because when I looked this thread for this question, I found a ChildrenOfType first in some thread.
Regarding  setting floating, I will test more.

Thanks
Kang
Tags
Docking
Asked by
Yonggu Kang
Top achievements
Rank 1
Iron
Answers by
George
Telerik team
Yonggu Kang
Top achievements
Rank 1
Iron
Share this question
or