Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions CS/DXDockingForLayoutPurposes/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<dxr:DXRibbonWindow
<dx:ThemedWindow
x:Class="DXDockingForLayoutPurposes.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Expand All @@ -12,12 +12,9 @@
xmlns:collections="clr-namespace:System.Collections;assembly=mscorlib"
Title="DXApplication" Height="700" Width="1100"
SnapsToDevicePixels="True" UseLayoutRounding="True"
dx:ThemeManager.ThemeName="DXStyle"
>
<dxr:DXRibbonWindow.Resources>

</dxr:DXRibbonWindow.Resources>

dx:ThemeManager.ThemeName="VS2019Light">
<dx:ThemedWindow.Resources>
</dx:ThemedWindow.Resources>
<dxd:DockLayoutManager x:Name="rootDockLayoutManager" AllowCustomization="True">
<dxd:LayoutGroup>
<dxd:DocumentPanel>
Expand Down Expand Up @@ -90,11 +87,8 @@
</dxd:LayoutGroup>
</dxd:LayoutGroup>
</dxd:LayoutGroup>

</local:DockLayoutManagerExt>

</dxd:DocumentPanel>
</dxd:LayoutGroup>
</dxd:DockLayoutManager>

</dxr:DXRibbonWindow>
</dxr:ThemedWindow>
24 changes: 3 additions & 21 deletions CS/DXDockingForLayoutPurposes/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,31 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Markup;
using DevExpress.Xpf.Core;
using DevExpress.Xpf.Ribbon;
using DevExpress.Xpf.Layout.Core;
using DevExpress.Xpf.Docking;
using DevExpress.Xpf.Docking.Base;
using DevExpress.Xpf.Docking.VisualElements;
using DevExpress.Xpf.Grid;
using DevExpress.Xpf.Core.Native;
using System.ComponentModel;
using System.Collections.ObjectModel;

namespace DXDockingForLayoutPurposes {
namespace DXDockingForLayoutPurposes
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : DXRibbonWindow {
public partial class MainWindow : ThemedWindow {
public MainWindow() {
InitializeComponent();
DataContext = new DataSource();
Expand Down
49 changes: 28 additions & 21 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
<!-- default badges list -->
![](https://img.shields.io/endpoint?url=https://codecentral.devexpress.com/api/v1/VersionRange/128643681/21.1.5%2B)
[![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/E4845)
[![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183)
<!-- default badges end -->
<!-- default file list -->
*Files to look at*:

* [DockLayoutManagerExt.cs](./CS/DXDockingForLayoutPurposes/DockLayoutManagerExt.cs) (VB: [DockLayoutManagerExt.vb](./VB/vb_DXDockingForLayoutPurposes/DockLayoutManagerExt.vb))
* [Helpers.cs](./CS/DXDockingForLayoutPurposes/Helpers.cs) (VB: [Helpers.vb](./VB/vb_DXDockingForLayoutPurposes/Helpers.vb))
* [MainWindow.xaml](./CS/DXDockingForLayoutPurposes/MainWindow.xaml) (VB: [MainWindow.xaml](./VB/vb_DXDockingForLayoutPurposes/MainWindow.xaml))
* [MainWindow.xaml.cs](./CS/DXDockingForLayoutPurposes/MainWindow.xaml.cs) (VB: [MainWindow.xaml.vb](./VB/vb_DXDockingForLayoutPurposes/MainWindow.xaml.vb))
<!-- default file list end -->
# How to limit LayoutGroup customization at runtime


<p>We have prepared an example demonstrating how to limit LayoutGroup customization at runtime.</p><p>To provide this functionality, we created a DockLayoutManager class descendant and the attached DisableCrossingGroupBoundaries property. The DisableCrossingGroupBoundaries property can be attached only to the LayoutGroup.</p><p>In this case, the LayoutGroup with the property assigned to true allows any customization and prevents moving inner elements outside LayoutGroup boundaries. For the LayoutGroup without this property, the default logic is used for arranging elements.</p>

<br/>


<!-- default badges list -->
[![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/E4845)
[![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183)
<!-- default badges end -->

# WPF Dock Layout Manager - Limit LayoutGroup Customization at Runtime

This example limits [LayoutGroup](https://docs.devexpress.com/WPF/DevExpress.Xpf.Docking.LayoutGroup) customization at runtime.

<img src="https://user-images.githubusercontent.com/12169834/175359371-47c8a0aa-9d45-470d-9f9f-a830ac39a423.png" width=900px/>

The example contains a [DockLayoutManager](https://docs.devexpress.com/WPF/DevExpress.Xpf.Docking.DockLayoutManager) class descendant and the attached `DisableCrossingGroupBoundaries` property. You can attach the `DisableCrossingGroupBoundaries` property only to the [LayoutGroup](https://docs.devexpress.com/WPF/DevExpress.Xpf.Docking.LayoutGroup).

In this case, a [LayoutGroup](https://docs.devexpress.com/WPF/DevExpress.Xpf.Docking.LayoutGroup) with the property assigned to `true` allows users to customize the group and prevents them moving inner elements outside [LayoutGroup](https://docs.devexpress.com/WPF/DevExpress.Xpf.Docking.LayoutGroup) boundaries. For the [LayoutGroup](https://docs.devexpress.com/WPF/DevExpress.Xpf.Docking.LayoutGroup) without this property, the default logic is used for arranging elements.


<!-- default file list -->
## Files to Look At

* [DockLayoutManagerExt.cs](./CS/DXDockingForLayoutPurposes/DockLayoutManagerExt.cs) (VB: [DockLayoutManagerExt.vb](./VB/vb_DXDockingForLayoutPurposes/DockLayoutManagerExt.vb))
* [Helpers.cs](./CS/DXDockingForLayoutPurposes/Helpers.cs) (VB: [Helpers.vb](./VB/vb_DXDockingForLayoutPurposes/Helpers.vb))
* [MainWindow.xaml](./CS/DXDockingForLayoutPurposes/MainWindow.xaml) (VB: [MainWindow.xaml](./VB/vb_DXDockingForLayoutPurposes/MainWindow.xaml))
* [MainWindow.xaml.cs](./CS/DXDockingForLayoutPurposes/MainWindow.xaml.cs) (VB: [MainWindow.xaml.vb](./VB/vb_DXDockingForLayoutPurposes/MainWindow.xaml.vb))
<!-- default file list end -->

## Documentation

- [Runtime Layout Customization](http://docs.devexpress.devx/WPF/7222/)