Getting floating window close button to not close all tabs?

9 posts, 0 answers
  1. Matthew
    Matthew avatar
    2 posts
    Member since:
    Feb 2013

    Posted 27 Feb 2013 Link to this post

    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>
  2. Vladi
    Admin
    Vladi avatar
    749 posts

    Posted 01 Mar 2013 Link to this post

    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.

  3. Matthew
    Matthew avatar
    2 posts
    Member since:
    Feb 2013

    Posted 01 Mar 2013 Link to this post

    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. 
  4. Vladi
    Admin
    Vladi avatar
    749 posts

    Posted 04 Mar 2013 Link to this post

    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.

  5. Lukas
    Lukas avatar
    3 posts
    Member since:
    May 2017

    Posted 19 Jun in reply to Vladi Link to this post

    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?
  6. Lukas
    Lukas avatar
    3 posts
    Member since:
    May 2017

    Posted 19 Jun in reply to Vladi Link to this post

    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?
  7. Martin Ivanov
    Admin
    Martin Ivanov avatar
    1331 posts

    Posted 22 Jun Link to this post

    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.
  8. Lukas
    Lukas avatar
    3 posts
    Member since:
    May 2017

    Posted 22 Jun in reply to Martin Ivanov Link to this post

    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.

  9. Martin Ivanov
    Admin
    Martin Ivanov avatar
    1331 posts

    Posted 27 Jun Link to this post

    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.
Back to Top