Does DockingManager come with built-in Anchorables processing method

When configuring AvalonDock with a set of Anchorables, for example:

<a:LayoutRoot> <a:LayoutPanel Orientation="Horizontal"> <a:LayoutAnchorablePane> <a:LayoutAnchorable Title="A1"> <!-- content --> </a:LayoutAnchorable> <a:LayoutAnchorable Title="A2"> <!-- content --> </a:LayoutAnchorable> </a:LayoutAnchorablePane> <!-- ... --> 

Is DockingManager (or something else in AvalonDock) accessible with a built-in way to manage bound objects that are closed? Are they stored somewhere in the collection so that they can be restored and displayed again?

For example, the user closes the first of the code above (A1), what happens to him?
How can I display it again?

What is a typical workflow for closing and restoring anchors?

+7
c # wpf xaml avalondock xceed
source share
1 answer

As you added the xceed tag, I assume that you are using Avalondock 2.0.

For example, the user closes the first of the code above (A1), what happens to him?

You become attached, hiding. If you decide to name your anchor (example: <a:LayoutAnchorable Title="A1" x:Name="myAnchorable"> ), in the code of your view you will see that this.myAnchorable.IsHidden becomes true .

How can I display it again?

Call .Show() against the binding: this.myAnchorable.Show();


Given that Avalondock 2.0 is completely different from 1.0, because now it makes it easy to use MVVM (especially bindings). Therefore, it would be best practice not to statically add LayoutAnchorable to XAML, but instead manage the ViewModels collection (with reference to the AnchorablesSource DockingManager property). Then it’s easy to show / hide the bindings because you just need to get / set the ViewModel property, which is bound to the Visibility LayoutAnchorableItem property.

You can see the example of WPF that Avalondock provides. This is a project called AvalonDock.MVVMTestApp in their source code .

+9
source share

All Articles