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

Maximize/Mimimize Floating RadPane

4 Answers 494 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Nathan
Top achievements
Rank 1
Nathan asked on 08 Dec 2016, 06:01 PM

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.

4 Answers, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 12 Dec 2016, 08:41 AM
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.
0
Nathan
Top achievements
Rank 1
answered on 12 Dec 2016, 04:51 PM

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?

0
Martin
Telerik team
answered on 14 Dec 2016, 08:44 AM
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.
0
Nathan
Top achievements
Rank 1
answered on 16 Dec 2016, 02:50 PM

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

 

Tags
Docking
Asked by
Nathan
Top achievements
Rank 1
Answers by
Martin
Telerik team
Nathan
Top achievements
Rank 1
Share this question
or