This project is read-only.

Can I remove close button from panels?

Feb 21, 2011 at 2:38 PM

I would like to remove/customize the panels for eg: remove close button

How can we do it? Any sample code please..

Thanks in advance.

-Jinij

Mar 1, 2011 at 3:27 PM
Edited Mar 5, 2011 at 9:14 AM

Hi,

have a look at this code located in DockablePaneStyle.xaml, lines 137++

<Button DockPanel.Dock="Right" Width="15" Height="15" Style="{StaticResource PaneHeaderCommandStyle}" Command="ad:DockablePaneCommands.Close"

                                   Visibility="{Binding RelativeSource={RelativeSource TemplatedParent},

                                   Path=SelectedItem.IsCloseable, Converter={x:Static ad:Converters.BoolToVisibilityConverter}}"

                                   ToolTip="{x:Static adRes:Resources.DockablePaneCommands_Close}">

                                   <!--<ad:AlignedImage>-->

                                   <ad:ImageEx Source="Images\PinClose.png" Width="13" />

                                   <!--</ad:AlignedImage>-->

</Button>

Same code at lines 183+ in DocumentPaneStyle.xaml

Hope it helps !

Bernard from Sofa, an AvalonDock wrapper.

Mar 4, 2011 at 6:12 AM

Thanks Bernad,

I set Visibility="Hidden" to the buttons. It disappears while running in Win XP.

In Windows 7, it is still visible and enabled.

Do I need to change any other portion?

Thanks,

-Jinij

Mar 5, 2011 at 9:14 AM

Could you check .Net versions running on your computers?

Also try Hidden vs Collapsed, see details here: http://msdn.microsoft.com/en-us/library/system.windows.visibility.aspx 

Bernard from Sofa, an AvalonDock wrapper