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

Command on RadPane HeaderCloseButton

2 Answers 74 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Andrew Thompson
Top achievements
Rank 1
Andrew Thompson asked on 19 Jan 2011, 10:12 PM
Hi there, 

I have a quick request - I'd like to bind a custom Command to a HeaderCloseButton on a pane docked on the left, top, bottom or top (ie: not as document). Any ideas how to do this?

I have achieved the same for tabbed documents by overriding the Pane HeaderTemplate as follows:

<!-- Define the style for component item headers -->
            <DataTemplate x:Key="PaneHeaderTemplate">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                    <TextBlock Text="{Binding ComponentDisplayName}"/>
                    <Button Command="{Binding CloseComponentCommand}" Style="{StaticResource ReportButtonStyle}"
                            Margin="10,0,0,0" ToolTipService.ToolTip="Remove Component">
                        <Button.Content>
                            <Path Data="M0,0 L6,6 M6, 0 L0,6" Stroke="Black" StrokeThickness="1"
                                    SnapsToDevicePixels="True" />
                        </Button.Content>
                    </Button>
                </StackPanel>
            </DataTemplate>

However modifying the TitleTemplate only changes the title area, not buttons on the pane. 

Any ideas? 

thanks!

2 Answers, 1 is accepted

Sort by
0
Pana
Telerik team
answered on 27 Jan 2011, 07:30 AM
Hello Andrew Thompson,

The buttons are part of the PaneGroup's Header control. The header (that contains the selected pane's title) is presented in left of these buttons so you can not access them through the pane header's data template. You can however edit the RadPaneGroup and modify the header in the template using Blend. You will generate a lot of XAML that way. Also I can send you the RadDocking xaml styles file if it would be of any help.

All the best,
Pana
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Andrew Thompson
Top achievements
Rank 1
answered on 27 Jan 2011, 08:31 AM
Hi Pana, 

Thanks for your response - I decided to resolve the issue with an event handler. Too much work just to keep MVVM intact!

Best regards, 
Andrew
Tags
Docking
Asked by
Andrew Thompson
Top achievements
Rank 1
Answers by
Pana
Telerik team
Andrew Thompson
Top achievements
Rank 1
Share this question
or