Does the DockingManager come with a built-in method for handling Anchorables

谁都会走 提交于 2019-12-05 02:43:19

As you added the xceed tag, I assume you're using Avalondock 2.0.

For example, the user closes the first one from the code above (A1), what happens to it?

You anchorable becomes hidden. If you choose to name your anchorable (example: <a:LayoutAnchorable Title="A1" x:Name="myAnchorable">), you'll see in the code of your view that this.myAnchorable.IsHidden becomes true.

How can I display it again?

Call .Show() against your anchorable: this.myAnchorable.Show();


That being said, Avalondock 2.0 is totally different from 1.0 because it now allows to use MVVM (especially bindings) easily. So the best practice would be to not statically add LayoutAnchorable in the XAML, but manage a collection of ViewModels instead (with a binding to the AnchorablesSource property of the DockingManager). Then it's easy to show/hide anchorables because you just have to get/set your ViewModel property that is bound to the Visibility property of LayoutAnchorableItem.

You could look at the WPF example Avalondock provides. It's the project named AvalonDock.MVVMTestApp in their code source.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!