I have an application that uses the XamDockManager control to manage various child windows. I'm looking for a way to capture the event when a window is un-docked and dragged out of the DockManager control and onto another computer screen and then auto-resize that window to full screen mode without having to double click the title bar.
my DockManager control is defined here:
<igDock:XamDockManager Name="DockManager" PaneDragEnded="XamDockManager_PaneDragEnded" AllowMaximizeFloatingWindows="True">
<igDock:XamDockManager.Panes>
<igDock:SplitPane>
<igDock:ContentPane Name="MainMenu" Header="Available Vipers" AllowClose="False" AllowDocking="False" AllowFloatingOnly="False" AllowDockingBottom="False" >
<DockPanel LastChildFill="True">
<StackPanel DockPanel.Dock="Bottom">
<WrapPanel Name="Taskbar" Orientation="Vertical"></WrapPanel>
<Button Content="Add Viper" Name="AddViper" Click="AddViper_Click" />
<Button Content="Alert" Name="Alert" Click="Alert_Click" />
<Button Content="Exit" Height="23" HorizontalAlignment="Right" Margin="0,0,12,12" Name="cmdExit" VerticalAlignment="Bottom" Width="75" Click="cmdExit_Click" />
</StackPanel>
<TreeView Name="Menu" BorderThickness="1" BorderBrush="Transparent">
<TreeViewItem Header="Department" Name="DepartmentTree" Selected="TreeViewItem_Selected" Style="{StaticResource TreeViewItemHeader}">
<TreeViewItem Header="Sample Dept 1" Name="Department_SampleDept1" >
<StackPanel Orientation="Horizontal">
<Image Source="/LiveVueCommandCenter;component/Images/viper.png" />
<Label Content="Room 123" Style="{StaticResource ViperLabel}" Tag="ViperTestCase" />
<Label Content="Bed 45a" Style="{StaticResource ViperLabel}" Tag="ViperTestCase" />
</TreeViewItem>
<TreeViewItem Header="Sample Dept 2" >
<Label Content="SR-9879" Style="{StaticResource ViperLabel}" Tag="ViperTestCase" />
<TreeViewItem Header="Group" Width="Auto" HorizontalAlignment="Stretch" Style="{StaticResource TreeViewItemHeader}">
<TreeViewItem Header="Perfusion Group 1" >
<TreeViewItem Header="User" Width="Auto" HorizontalAlignment="Stretch" Style="{StaticResource TreeViewItemHeader}">
<TreeViewItem Header="Admin" >
<TreeViewItem Header="Dr. John Smith" >
</TreeView>
</DockPanel>
</igDock:ContentPane>
</igDock:SplitPane>
<igDock:SplitPane SplitterOrientation="Horizontal" Name="ViperContentArea" >
</igDock:XamDockManager.Panes>
</igDock:XamDockManager>
Here is the event that I am catching
private void XamDockManager_PaneDragEnded(object sender, Infragistics.Windows.DockManager.Events.PaneDragEndedEventArgs e)
{
var activePane = ((XamDockManager)e.Source).ActivePane;
}
Any ideas and suggestions would be great, thanks
Hello Mike Dutra,
In the PaneDragEnded event you can get the ToolWindow of the active pane using the GetToolWindow() method. There is a WindowState that you can set to Maximized. E.g.:
ToolWindow.GetToolWindow(activePane).WindowState = WindowState.Maximized;
Let me know if you have any questions with this matter. Thank you.
Hi Duane,
Thanks for your reply, however this isn't quite what I was looking for, nor did it work for me. I tried a few permutations in the xamDockManager, but none of them worked. Here is what I tried:
<igDock:XamDockManager Name="DockManager" PaneDragEnded="XamDockManager_PaneDragEnded" AllowMaximizeFloatingWindows="True" FloatingWindowDragMode="UseDragFullWindowsSystemSetting" AllowMinimizeFloatingWindows="True">
<igDock:XamDockManager Name="DockManager" PaneDragEnded="XamDockManager_PaneDragEnded" AllowMaximizeFloatingWindows="False" FloatingWindowDragMode="UseDragFullWindowsSystemSetting" AllowMinimizeFloatingWindows="False">
<igDock:XamDockManager Name="DockManager" PaneDragEnded="XamDockManager_PaneDragEnded" AllowMaximizeFloatingWindows="True" FloatingWindowDragMode="UseDragFullWindowsSystemSetting" AllowMinimizeFloatingWindows="False">
Also, It looks as though this functionality would allow user to maximize the window when it is dragged to the top of the screen like a normal Windows 7 app. What I'm hoping to do is allow the user to drag a panel into an undocked location on another screen, and then have it maximize to the full screen when it is dropped without having to drag the window to the top of the screen.
Is it possible to access and set properties for the height/width of the floating panel? I've searched for them in the documentation and intellisense, however nothing jumped out at me.
thanks again
In the following help documentation describes on setting the different modes for the panes when dragging: http://help.infragistics.com/NetAdvantage/WPF/2011.2/CLR4.0/?page=xamDockManger_Dragging_Panes.html. For example on maximizing a pane after dragging you can set the FloatingWindowDragMode property to "UseDragFullWindowsSystemSetting".