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
3590
Auto maximize an undocked window on PaneDragEnded event
posted

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" />

                                        </StackPanel>

 

                                        <StackPanel Orientation="Horizontal">

                                            <Image Source="/LiveVueCommandCenter;component/Images/viper.png" />

                                            <Label Content="Bed 45a" Style="{StaticResource ViperLabel}" Tag="ViperTestCase" />

                                        </StackPanel>

                                    </TreeViewItem>

 

                                    <TreeViewItem Header="Sample Dept 2" >

                                        <StackPanel Orientation="Horizontal">

                                            <Image Source="/LiveVueCommandCenter;component/Images/viper.png" />

                                            <Label Content="SR-9879" Style="{StaticResource ViperLabel}" Tag="ViperTestCase" />

                                        </StackPanel>

                                    </TreeViewItem>

 

                                </TreeViewItem>

 

                                <TreeViewItem Header="Group" Width="Auto" HorizontalAlignment="Stretch" Style="{StaticResource TreeViewItemHeader}">

                                    <TreeViewItem Header="Perfusion Group 1" >

                                        <StackPanel Orientation="Horizontal">

                                            <Image Source="/LiveVueCommandCenter;component/Images/viper.png" />

                                            <Label Content="SR-9879" Style="{StaticResource ViperLabel}" Tag="ViperTestCase" />

                                        </StackPanel>

                                    </TreeViewItem>

 

                                </TreeViewItem>

 

                                <TreeViewItem Header="User" Width="Auto" HorizontalAlignment="Stretch" Style="{StaticResource TreeViewItemHeader}">

                                    <TreeViewItem Header="Admin" >

                                        <StackPanel Orientation="Horizontal">

                                            <Image Source="/LiveVueCommandCenter;component/Images/viper.png" />

                                            <Label Content="SR-9879" Style="{StaticResource ViperLabel}" Tag="ViperTestCase" />

                                        </StackPanel>

                                    </TreeViewItem>

 

                                    <TreeViewItem Header="Dr. John Smith" >

                                        <StackPanel Orientation="Horizontal">

                                            <Image Source="/LiveVueCommandCenter;component/Images/viper.png" />

                                            <Label Content="SR-9879" Style="{StaticResource ViperLabel}" Tag="ViperTestCase" />

                                        </StackPanel>

                                    </TreeViewItem>

                                </TreeViewItem>

 

                            </TreeView>

 

                        </DockPanel>

                    </igDock:ContentPane>

                </igDock:SplitPane>

 

                <igDock:SplitPane SplitterOrientation="Horizontal" Name="ViperContentArea" >

 

                </igDock:SplitPane>

            </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

Parents
No Data
Reply
  • 12004
    Verified Answer
    posted

    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.

Children
No Data