Remove/Disable CloseButton on a Dock Panel

StatusIDPriorityType
Closed29869MajorQuestion
ProfileReply
gabossoloClient

How to remove or disable CloseButton on a Dock Panel?

Replies

UserDescriptionPosted On
MariyaVoytovichAgent

Hello gabossolo!

Unfortunately, We do not quite understand your issue.
Please, send us additional information.

Regards,
Mariya
On behalf of Xafari Client Services Team

gabossoloClient

Please refer to this page:

https://documentation.galaktika-soft.com/xafari/doc_dock_panels_design_time_features
SECTION: Settings specific to the Web platform

How to remove ShowCloseButton on Win-platform?

Thanks!

MariyaVoytovichAgent

Hello!

At the moment for the Win-platform are not implemented settings that remove the CloseButton.
Settings will appear in the 13th version of the Xafari.
But you can implement the settings yourself.

For this you need:
1. Add "ShowCloseButton" property to an IModelDockPanel.
To add new property to an IModelDockPanel, you should first define an interface and expose the property:

public interface IModelMyDockPanel : IModelDockPanel
{
[Category("Appearance")]
[Description("Specifies whether a DockPanel close button is displayed. 'True' if the button is displayed; otherwise, 'False'.")]
[DefaultValue(true)]
bool ShowCloseButton { get; set; }
}

Then, extend the IModelMyDockPanel node in your Module or Controller. Override the ModuleBase.ExtendModelInterfaces method or implement the IModelExtender interface, respectively.
public sealed partial class MySolutionModule : ModuleBase {
// ...
public override void ExtendModelInterfaces(ModelInterfaceExtenders extenders) {
base.ExtendModelInterfaces(extenders);
extenders.Add<IModelDockPanel, IModelMyDockPanel>();
}
// ...
}

2. Inherit from the XafariDockingWinWindowController controller:
public class CustomizeDocPanelsViewController : XafariDockingWinWindowController
{
protected override void OnEndInit()
{
base.OnEndInit();
foreach (var supportInitialize in this.AllPanels.Values.OfType())
{
var dockPanelItem = (DockPanelItemWin)supportInitialize;
var model = dockPanelItem.Model as IModelMyDockPanel;
if (model != null)
dockPanelItem.DockPanel.Options.ShowCloseButton =
model.ShowCloseButton;
}
this.RefreshActionItems(true);
}
}

Let us know if you need further assistance.

Regards,
Mariya
On behalf of Xafari Client Services Team

gabossoloClient

Thank you!

× This ticket is closed.

Write US