■ DockingManager 엘리먼트를 사용하는 방법을 보여준다.
▶ 예제 코드 (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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
<Window x:Class="WpfApplication6.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:xcad="http://schemas.xceed.com/wpf/xaml/avalondock" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" Width="800" Height="600" Title="DockingManager 엘리먼트 사용하기"> <Grid> <xcad:DockingManager BorderBrush="Black" BorderThickness="1" AllowMixedOrientation="True"> <xcad:DockingManager.DocumentHeaderTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <Image Source="{Binding IconSource}" Margin="0 0 4 0" /> <TextBlock Text="{Binding Title}" /> </StackPanel> </DataTemplate> </xcad:DockingManager.DocumentHeaderTemplate> <xcad:LayoutRoot x:Name="layoutRoot"> <xcad:LayoutPanel Orientation="Horizontal"> <xcad:LayoutAnchorablePane DockWidth="200"> <xcad:LayoutAnchorable ContentId="property" AutoHideWidth="240" CanHide="False" CanClose="False" Title="속성"> <xctk:PropertyGrid NameColumnWidth="110" SelectedObject="{Binding ElementName=layoutRoot, Path=LastFocusedDocument.Content}" /> </xcad:LayoutAnchorable> </xcad:LayoutAnchorablePane> <xcad:LayoutDocumentPaneGroup > <xcad:LayoutDocumentPane> <xcad:LayoutDocument ContentId="document1" Title="문서 #1"> <Button HorizontalAlignment="Center" VerticalAlignment="Center" Content="문서 #1 내용" /> </xcad:LayoutDocument> <xcad:LayoutDocument ContentId="document2" Title="문서 #2"> <TextBox AcceptsReturn="True" Text="문서 #2 내용" /> </xcad:LayoutDocument> </xcad:LayoutDocumentPane> </xcad:LayoutDocumentPaneGroup > <xcad:LayoutAnchorablePaneGroup DockWidth="125"> <xcad:LayoutAnchorablePane> <xcad:LayoutAnchorable ContentId="alarm" Title="알람"> <ListBox> <s:String>Alarm 1</s:String> <s:String>Alarm 2</s:String> <s:String>Alarm 3</s:String> </ListBox> </xcad:LayoutAnchorable> <xcad:LayoutAnchorable ContentId="journal" Title="저널"> <RichTextBox> <FlowDocument> <Paragraph FontSize="14" FontFamily="Segoe"> This is the content of the Journal Pane. <LineBreak /> A <Bold>RichTextBox</Bold> has been added here </Paragraph> </FlowDocument> </RichTextBox> </xcad:LayoutAnchorable> </xcad:LayoutAnchorablePane> </xcad:LayoutAnchorablePaneGroup> </xcad:LayoutPanel> <xcad:LayoutRoot.LeftSide> <xcad:LayoutAnchorSide> <xcad:LayoutAnchorGroup> <xcad:LayoutAnchorable ContentId="agenda" Title="의제"> <TextBlock Margin="10" FontSize="18" FontWeight="Black" TextWrapping="Wrap" Text="의제 내용" /> </xcad:LayoutAnchorable> <xcad:LayoutAnchorable ContentId="contacts" Title="연락처"> <TextBlock Margin="10" FontSize="18" FontWeight="Black" TextWrapping="Wrap" Text="연락처 내용" /> </xcad:LayoutAnchorable> </xcad:LayoutAnchorGroup> </xcad:LayoutAnchorSide> </xcad:LayoutRoot.LeftSide> </xcad:LayoutRoot> </xcad:DockingManager> </Grid> </Window> |
※ 참조
. Xceed.Wpf.AvalonDock
. Xceed.Wpf.Toolkit