Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
180
XamDockManager Content Pane CloseButtonVisibility=Hidden has no effect when in floating state
posted

Hi,

 

We are using NetAdvantage for WPF 11.3 and we face a strange issue.

 

We modified  the Docking_Simple sample by adding a CloseButtonVisibility ="Hidden"  in leftEdgeDock pane.

When the pane is docked the close (cross) button is hidden as expected but

when the pane is in floating state the close is no more hidden.


How can we hide this red cross in content pane header also when in floating state?


We noticed that we can disable it (AllowClose="False" ) but our user do not want to see it.


 

  • 27093
    posted

    Hello ,

    I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.

    If the above suggestion helped you solve your issue please verify the thread as answered so other users may take better advantage of it.

  • 54937
    Suggested Answer
    Offline posted

    The CloseButtonVisibility only affects the Visibility of the button in the PaneHeaderPresenter - it does not affect the Close button displayed for the floating window. When only 1 ContentPane is in view within a floating window, the PaneHeaderPresenter is collapsed and the caption area is provided by the floating window (the PaneToolWindow) which is the behavior demonstrated by VS 2008 and prior. 

    By default the xamDockManager uses a WPF Window with a WindowStyle of ToolWindow. It is not possible to have the OS remove the close button of such a window. You could handle the ToolWindowLoaded and set the UseOsNonClientArea of the e.Window to false. This would cause the ToolWindow to not use the OS non-client area but instead would provide the chrome for the "non-client area" itself via its template. That too wouldn't be related to the contentpane and therefore wouldn't use the CloseButtonVisibility since a PaneToolWindow can show multiple ContentPanes but if you really wanted you could retemplate that element (the PaneToolWindow) and remove the close button within its template. 

    If you are using v11.1 or later then another option might be to set the FloatingWindowCaptionSource to UseContentPaneCaption. When this is set and the PaneToolWindow only has 1 ContentPane in view then it will not use its own caption area but will let the PaneHeaderPresenter of the ContentPane remain in view similar to how VS 2010 uses the same caption for the pane when docked or floating. Note, the PaneToolWindow's caption could still be shown if there are more than 1 ContentPanes in view within the floating window just as would happen in VS 2010.