Hide the toolwindow.

Docking/MDI for WPF Forum

Posted 12 years ago by keshav bansal
Version: 12.1.0561
Avatar

Hi,

I am able to register the usercontrols as the toolwindow in my main application using prismIntegration with dockingg  So Is there any functionality to hide the toolwindow ?

lIke i can Activate() or close() the toolwindow.

Case 1: If i close the toolwindow using the close button in the title of that toolwindow(either close or hide that toolwindow) and then call the Activate() its will display.

So for the same above case if don't want to click on the close button of the title and  click on the any other  button What should i call for that toolwindow(Like hide that window) and after that call  Activate() its should display.

I should be able to do like user clicks the button and it will hide the toolwindow and  click the button it will show the toolwindoow. 

[Modified 12 years ago]

Comments (5)

Answer - Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Keshav,

If you want to close the window with similar function to clicking the "X" button (the close window in the title) then you should call Close() on the ToolWindow as it is effectively the same process. Then you can do the same process you did before to show the ToolWindow again with Activate().


Actipro Software Support

Posted 11 years ago by Sasha
Avatar

Hi, I have following code:

 

  <docking:ToolWindow x:Uid="ToolBoxEigenschaften" Title="{DynamicResource Eigenschaften}" ImageSource="/Resources\png\Toolbox16.png" x:Name="ToolBoxEigenschaften" 
                                            CanClose="False" HasOptions="False" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" >
                            <docking:ToolWindow.Header>
                                <TextBlock Text="{DynamicResource Eigenschaften}"/>
                            </docking:ToolWindow.Header>

                            <DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Dock="Top">

                                <DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Dock="Top" >
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="*"/>
                                        </Grid.ColumnDefinitions>
                                        <Button Name="SaveBtn" Content="    Save    " IsEnabled="{Binding SaveButtonIsEnabled}" Grid.Column="0" >
                                            <i:Interaction.Triggers>
                                                <i:EventTrigger EventName="MouseRightButtonDown">
                                                    <ei:CallMethodAction TargetObject="{Binding}" MethodName="SaveBtnClick"/>
                                                </i:EventTrigger>
                                            </i:Interaction.Triggers>
                                        </Button>
                                        <Button Name="EditBtn" Content="    Edit    " Grid.Column="1" HorizontalAlignment="Stretch">
                                            <i:Interaction.Triggers>
                                                <i:EventTrigger EventName="MouseRightButtonDown">
                                                    <ei:CallMethodAction TargetObject="{Binding}" MethodName="EditBtnClick"/>
                                                </i:EventTrigger>
                                            </i:Interaction.Triggers>
                                        </Button>
                                    </Grid>
                                </DockPanel>

                                <DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Dock="Bottom">
                                    <shared:PixelSnapper  x:Uid="shared:PixelSnapper_1" HorizontalRoundMode="Floor" VerticalRoundMode="Floor">
                                        <propgrid:PropertyGrid x:Uid="PropertiesUserControl" x:Name="PropertiesUserControl"  IsSummaryVisible="True" AreNestedCategoriesSupported="True" 
                                                           IsAsynchronous="True" IsEnabled="True" AreDefaultSortDescriptionsEnabled="False"
                                                           AreCategoriesAutoExpanded="False" SelectedObject="{Binding SelectedObject}">
			                </propgrid:PropertyGrid>
                                    </shared:PixelSnapper>
                                </DockPanel>

                            </DockPanel>
                        </docking:ToolWindow>

 What I want is to activate toolWindow with Activate() from my viewModel. Is it possible to make with xaml property or I should create all dynamically, and for ToolWindow set binding to a Content?

Thank you

Posted 11 years ago by keshav bansal
Avatar

Hi,

If you want to display the Toolwindow as you run your main application then

Hirarchy should be like this

<docking:DockSite>

<docking:ToolWindowContainer>

<docking:ToolWindow>

 <Grid>

//Content will comes here

</Grid>

</docking:ToolWindow>

</docking:ToolWindowContainer>

</docking:Docksite>

 

Case 2:  Dynamically load the Toolwindow with th ehelp of the PrismIntegration concept and after that Progranmatcially  you can call the Toolwindow.Activate().

Posted 11 years ago by Sasha
Avatar

Thank you

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Sasha,

If you just mean you want to make a class that is a ToolWindow and open it later on, check out our CustomDockingWindows QuickStart.  That shows how to make a class for a particular ToolWindow, then you can new it up and Activate() it.


Actipro Software Support

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.