Maximize/Mimimize Floating RadPane

5 posts, 0 answers
  1. Nathan
    Nathan avatar
    3 posts
    Member since:
    Jun 2016

    Posted 08 Dec 2016 Link to this post

    I'm trying to add maximize, minimize and restore buttons to the header of floating radpanes.  I know it's maximizeable by double-clicking the header, but there is no way to minimize, and I'll like to add both options for a better user experience.

     

    I've been successful in adding floating panes to the taskbar using the following code by overriding DefaultGeneratedItemsFactory.CreateToolWindow:

            public override ToolWindow CreateToolWindow()
            {
                var window = base.CreateToolWindow();

                //make floating windows show in taskbar
                RadWindowInteropHelper.SetShowInTaskbar(window, true);
                RadWindowInteropHelper.SetIcon(window, Application.Current.MainWindow.Icon);

                window.SetBinding(RadWindowInteropHelper.TitleProperty, new Binding("Header") { Source = window });
                
                return window;
            }

    and I now just need to minimize/maximize/restore to work like a standard window.

  2. Martin
    Admin
    Martin avatar
    88 posts

    Posted 12 Dec 2016 Link to this post

    Hi Nathan,

    You could make use of the RadWindow's commands for minimize, maximize etc. You could retemplate the ToolWindow to include buttons for Minimize, Maximize, etc and bind their commands to the appropriate ones from telerik:WindowCommands. (a quick example button to include in the header would be):

    <telerik:RadButton x:Name="MinimizeButton" Command="{x:Static telerik:WindowCommands.Minimize}" Content="_"  />

    Review the template of the RadWindow for more information about how this is achieved there. Note that you might need to use noXAML assemblies in order to more easily style all the instances of the ToolWindow and you need to define the modified style in the App.xaml, because they will not be part of the MainWindow and will not receive it if it is defined in Window.Resources.

    Regards,
    Martin
    Telerik by Progress
    Telerik UI for WPF is ready for Visual Studio 2017 RC! Learn more.
  3. Nathan
    Nathan avatar
    3 posts
    Member since:
    Jun 2016

    Posted 12 Dec 2016 in reply to Martin Link to this post

    My problem with re-templating is that our application allows the user to choose any telerik theme, and the theme resources are loaded dynamically.  Because of this, I would have to create a separate ToolWindow template for each theme.

    That also introduces upgrade issues where Telerik template fixes won't auto-update when I set up my own.  

    Is there any other way to add those buttons without recreating the templates locally?

  4. Martin
    Admin
    Martin avatar
    88 posts

    Posted 14 Dec 2016 Link to this post

    Hello Nathan,

    You can review the following article about adding buttons to the Pane headers. You can pass a DataTemplate in the TitleTemplate of the needed Panes with a ContentPresenter Content="{Binding}" and  the addition buttons with commands. This might help you avoid modifying templates for each theme.

    Regards,
    Martin
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  5. Nathan
    Nathan avatar
    3 posts
    Member since:
    Jun 2016

    Posted 16 Dec 2016 in reply to Martin Link to this post

    Our project already modifies the Pane header for RadPanes, and I'd love it if there was support for that in a ToolWindow that is theme-independent. However, I don't see how that helps me since what I'm requesting only applies while the RadPane is floating, not for a RadPane in general.

    I came across the following feature request (https://feedback.telerik.com/Project/143/Feedback/Details/120945-docking-toolwindow-add-minimize-restore-maximize-header-buttons), which seems to cover what I'm looking for.  +1

     

Back to Top