Removing the close button from a floating pane

3 posts, 1 answers
  1. Jonathan
    Jonathan avatar
    15 posts
    Member since:
    Dec 2014

    Posted 21 May 2015 Link to this post

    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. Answer
    Nasko
    Admin
    Nasko avatar
    587 posts

    Posted 26 May 2015 Link to this post

    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
  3. DevCraft banner
  4. Jonathan
    Jonathan avatar
    15 posts
    Member since:
    Dec 2014

    Posted 26 May 2015 in reply to Nasko Link to this post

    Thanks Nasko. Works perfectly.
Back to Top