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

Getting floating window close button to not close all tabs?

8 Answers 142 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Matthew
Top achievements
Rank 1
Matthew asked on 28 Feb 2013, 05:44 AM
Below is a simple docking application. After the app loads I tear out the panels and dock them together into a single floating window. I end up with a floating tabbed window with several tabs. If I press the close button of the floating panel the entire floating panel and all the tabbed items in it close. How would I get this to only close the active item in the tabbed view instead of all the items and the panel? E.g. if the floating panel has tabs for A, B and C, and B is active when I press close, then the panel would remain floating with tabs A and C still present. 

<Window
        xmlns:telerikDocking="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Docking"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="RadControlsDocking.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
 
        <telerikDocking:RadDocking>
            <telerikDocking:RadDocking.DocumentHost>
                <telerikDocking:RadSplitContainer>
                    <telerikDocking:RadPaneGroup>
                        <telerikDocking:RadDocumentPane Header="A"/>
                        <telerikDocking:RadDocumentPane Header="B"/>
                        <telerikDocking:RadDocumentPane Header="C"/>
                        <telerikDocking:RadDocumentPane Header="D"/>
                        <telerikDocking:RadDocumentPane Header="E"/>
                        <telerikDocking:RadDocumentPane Header="F"/>
                        <telerikDocking:RadDocumentPane Header="G"/>
                    </telerikDocking:RadPaneGroup>
                </telerikDocking:RadSplitContainer>
            </telerikDocking:RadDocking.DocumentHost>
        </telerikDocking:RadDocking>
 
    </Grid>
</Window>

8 Answers, 1 is accepted

Sort by
0
Vladi
Telerik team
answered on 01 Mar 2013, 04:12 PM
Hello Matthew,

By design in the RadDocking control when the close button of a floating PaneGroup is clicked it closes the ToolWindow in which the PaneGroup is placed.

In order to achieve the desired behavior you will need to customize the ToolWindow in which the floating Panes are placed and override its OnClosing() method.

We created and attached a sample project for you showing the described approach, hope this is helpful.

Greetings,
Vladi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Matthew
Top achievements
Rank 1
answered on 01 Mar 2013, 06:47 PM
Thank you for posting that Vladi. This method works, but it works by setting the Pane visibility rather than using a RemoveFromParent() call. If I attempt to use RemoveFromParent() in the overriden OnClosing() method the whole tool window still closes. Is there perhaps an extension to RemoveFromParent that can limit the Pane closing to only one pane? I'd like to get something a little more like Visual Studio in the floating pane closing behavior. For now I'm thinking of just moving the targeted pane to a new hidden tool window and then closing the panel from there. 
0
Vladi
Telerik team
answered on 04 Mar 2013, 03:19 PM
Hi Matthew,

We tried to reproduce the issue when calling the RemoveFromParent() method in the OnClosing() method but with no success. When the Pane is removed by calling the RemoveFromParent() method only the Pane is removed not the hole ToolWindow.

I recorded and attached a short video for you showing how the project run on our side. Could you confirm that you are using the 2013.1 220 version of RadControls as states in the post details?

Regards,
Vladi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Lukas
Top achievements
Rank 1
answered on 19 Jun 2017, 12:36 PM
This works, but if dragged out - on creation of a real floating Tool Window, meaning it is lot longer hosted inside the RadDocking - it's invisible. How to make CustomToolWindow visible?
0
Lukas
Top achievements
Rank 1
answered on 19 Jun 2017, 12:38 PM
This works, but upon dragging it outside the splitcontainer, the Toolwindow is invisible instead. Shouldn't a derived version of ToolWindow have the same visual appearance as its Baseclass as long as only the OnClosing-Method is overridden?
0
Martin Ivanov
Telerik team
answered on 22 Jun 2017, 10:18 AM
Hello Lukas,

I am not sure what you mean by saying that you are creating a real floating Tool Window and it is lot longer hosted in the docking? Can you clarify this?

As for the visual appearance of the custom tool window, if you use the normal xaml version of the UI for WPF dlls the style of the default window will be automatically inherited by the custom window. On the other hand if you use NoXaml dlls you will need to define a style for the custom window and base it on the default ToolWindowStyle. Check this approach in the Styling the Controls help article.
<Style TargetType="local:CustomToolWindow" BasedOn="{StaticResource ToolWindowStyle}" />

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Lukas
Top achievements
Rank 1
answered on 22 Jun 2017, 11:12 AM

Hi Martin

What I ment was, when I grab and pull out a RadPane from the PaneGroup, it then creates a CustomToolWindow, which is invisible.

In fact I am using the NoXaml Binaries. Changing to the normal Binaries does slightly change the visual appearance of the hole Application, that's why I have chosen your second suggestion, which worked as expected, with no visual sideeffects. Thank you.

So far I haven't really been thinking about the difference between those binaries, because both seem to work with Theming I have been randomly picking the NoXaml Bins, without asking no question during the Trial Phase, which I didn't change. Might you Post some links, which do exactly describe the different behavior upon styling, native look, and other characteristics in which they differ.

Thank you so far.

0
Martin Ivanov
Telerik team
answered on 27 Jun 2017, 10:35 AM
Hello Matthew,

I would suggest you check the articles in the Styling and Appearance section in the help documentation. As for the difference between the dlls version (Xaml and NoXaml), well, visually there are no differences between the controls. The only thing that differs is that the Xaml dlls have the control styles for all themes embedded in them. On the other hand the NoXaml version has no styles which makes them smaller in size. Also, the NoXaml dlls allows easier theme changing and styles customization.

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Docking
Asked by
Matthew
Top achievements
Rank 1
Answers by
Vladi
Telerik team
Matthew
Top achievements
Rank 1
Lukas
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or