Category / Section
How to collapse the center drag provider of the WPF DockingManager?
1 min read
DockAbility property of WPF DockingManager has been used to set the desired dock side for the child element. To collapse the center, drag provider of DockingManager, we can set Dockablity of each child element of DockingManager to Horizontal and Vertical. The following code demonstrates the same,
C#
public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); docking.Loaded += Docking_Loaded; } private void Docking_Loaded(object sender, RoutedEventArgs e) { foreach(var child in docking.Children) { DockingManager.SetDockAbility(child as DependencyObject, DockAbility.Horizontal | DockAbility.Vertical); } } }
Note:
Multiple values of DockAbility cannot be set though xaml.