■ DockLayoutManager 클래스에서 DX 도킹 라이브러리에서 제공된 명령을 버튼과 결합하는 방법을 보여준다.
▶ MainWindow.xaml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
<Window x:Class="TestProject.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:dxd="http://schemas.devexpress.com/winfx/2008/xaml/docking" Width="800" Height="600" Title="DX 도킹 라이브러리에서 제공된 명령을 버튼과 결합하기" FontFamily="나눔고딕코딩" FontSize="16"> <DockPanel> <ToolBar x:Name="toolBar" DockPanel.Dock="Top" HorizontalAlignment="Left" VerticalAlignment="Top" Height="26"> <Button Command="dxd:DockControllerCommand.Close" CommandTarget="{Binding ElementName=dockLayoutManager}" CommandParameter="{Binding ElementName=dockLayoutManager, Path=ActiveDockItem}"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <Image Grid.Column="0" Source="pack://application:,,,/Image/delete.png" /> <TextBlock Grid.Column="1" VerticalAlignment="Center"> Close Active Dock Panel </TextBlock> </Grid> </Button> </ToolBar> <dxd:DockLayoutManager x:Name="dockLayoutManager"> <dxd:LayoutGroup Orientation="Horizontal"> <dxd:LayoutGroup Orientation="Horizontal"> <dxd:LayoutPanel x:Name="layoutPanel1" Caption="Panel 1" /> <dxd:LayoutPanel x:Name="layoutPanel2" Caption="Panel 2" /> </dxd:LayoutGroup> <dxd:DocumentGroup x:Name="documentGroup"> <dxd:DocumentPanel x:Name="documentPanel1" Caption="Document 1"> <RichTextBox /> </dxd:DocumentPanel> <dxd:DocumentPanel x:Name="documentPanel2" Caption="Document 2"> <RichTextBox /> </dxd:DocumentPanel> </dxd:DocumentGroup> </dxd:LayoutGroup> <dxd:DockLayoutManager.AutoHideGroups> <dxd:AutoHideGroup DockType="Right"> <dxd:LayoutPanel x:Name="propertyLayoutPanel" Caption="Property" /> </dxd:AutoHideGroup> </dxd:DockLayoutManager.AutoHideGroups> <dxd:DockLayoutManager.FloatGroups> <dxd:FloatGroup FloatLocation="200 100" FloatSize="400 200"> <dxd:LayoutPanel x:Name="messageLayoutPanel" Caption="Message"> <RichTextBox /> </dxd:LayoutPanel> </dxd:FloatGroup> </dxd:DockLayoutManager.FloatGroups> </dxd:DockLayoutManager> </DockPanel> </Window> |
▶ MainWindow.xaml.cs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
using System.Windows; namespace TestProject { /// <summary> /// 메인 윈도우 /// </summary> public partial class MainWindow : Window { //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor ////////////////////////////////////////////////////////////////////////////////////////// Public #region 생성자 - MainWindow() /// <summary> /// 생성자 /// </summary> public MainWindow() { InitializeComponent(); this.dockLayoutManager.DockController.Activate(this.messageLayoutPanel); } #endregion } } |