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

Removing the close button from a floating pane

2 Answers 22 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 21 May 2015, 07:25 AM

Hi,

Is there a way to remove the close button from a floating pane? Setting CanUserClose to False only removes it from pinned/unpinned panes. It's still there when the pane is floating, though it's disabled. I don't want it to show at all since that's confusing to the user.

Thanks,
Jonathan

2 Answers, 1 is accepted

Sort by
0
Accepted
Nasko
Telerik team
answered on 26 May 2015, 05:58 AM
Hello Jonathan,

In order to achieve the desired appearance of the ToolWindow (floating pane) you need to modify its default Style's Template. In that ControlTemplate the Button with x:Name="CloseButton" should be removed - thus the desired appearance should be achieved:
<Style BasedOn="{StaticResource ToolWindowStyle}" TargetType="dock:ToolWindow">
    <Setter Property="Template">
        ...
        <!--Remove the Button-->
        <!--<telerik:RadButton x:Name="CloseButton" Style="{StaticResource ToolWindow_CloseButtonStyle}" Grid.Row="0" Grid.Column="1" Margin="1 1 3 1" Command="telerik:WindowCommands.Close"/>-->
        ...
    </Setter>
</Style>

We also recommend you to use Implicit Styles  because many of the parts of the control are dynamically created including the ToolWindows. In order for those dynamically created elements to be styled correctly the custom style should be added to the App.xaml.

Hopes this helps.

Regards,
Nasko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Jonathan
Top achievements
Rank 1
answered on 26 May 2015, 11:06 AM
Thanks Nasko. Works perfectly.
Tags
Docking
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Jonathan
Top achievements
Rank 1
Share this question
or