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

how do you wire events such as resize for a floating window?

2 Answers 110 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Rick Feuer
Top achievements
Rank 1
Rick Feuer asked on 07 May 2010, 09:06 PM
When you undock a radPane, the control apparently becomes a tool window.  I can't figure out how to wire events like resize and move for the floating window. My panes are all created in xaml and are initially docked. Is there a docking manager that keeps track of undocked windows and events?

Thanks

Rick

2 Answers, 1 is accepted

Sort by
0
Rick Feuer
Top achievements
Rank 1
answered on 10 May 2010, 07:46 PM
This is the solution I came up with. In the Docking panestateChanged handler:


 

void radDock_PaneStateChange(object sender, Telerik.Windows.RadRoutedEventArgs e)

 

{

 

var pane = e.OriginalSource as RadPane;

 

 

var p = pane.Parent as ISplitItem;

 

 

var container = p.ParentContainer;

 

 

while (container != null)

 

{

p = container;

container = p.ParentContainer;

}

container = p

as RadSplitContainer;

 

 

if (container.Parent != null && container.Parent.GetType() == typeof(ToolWindow))

 

{

 

ToolWindow floatingWindow = container.Parent as ToolWindow;

 

floatingWindow.SizeChanged += floatingWindow_SizeChanged;

}

}

0
Miroslav Nedyalkov
Telerik team
answered on 12 May 2010, 02:48 PM
Hi Rick,

 Thank you for your suggestion! You could do exactly the same thing with a less code by using the ParentOfType<ToolWindow>() extension method instead of going up the logical tree. The result will be exactly the same.

Another approach could be to track the SizeChanged event of the content of the pane.

All the best,
Miroslav Nedyalkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Docking
Asked by
Rick Feuer
Top achievements
Rank 1
Answers by
Rick Feuer
Top achievements
Rank 1
Miroslav Nedyalkov
Telerik team
Share this question
or