In AvalonDock, is it possible to modify a LayoutAnchorablePane's CanClose property dynamically at runtime? I would like to prevent/lock layout changes unless the user specifically desires to do so and turns it on.
I have tried the following approaches:
- Binding: It is not possible to bind the property because it is not a
DependencyPropertyso something like this doesn't work:<dock:LayoutAnchorable CanClose="{Binding CanClose}"> CanCloseproperty: Changing theLayoutAnchorablePane'sCanCloseproperty in code-behind is not possible because the property is read-only.
According to the source code of
LayoutAnchorablePane:the
CanCloseproperty depends on all children of the pane, so one way to change the value ofCanCloseof aLayoutAnchorablePaneis to set all its children'sCanCloseproperty to the value you want. Below is an example: