첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
유용한 소스 코드가 있으면 icodebroker@naver.com으로 보내주시면 감사합니다.
블로그 자료는 자유롭게 사용하세요.

■ DockingManager 엘리먼트 사용하기

----------------------------------------------------------------------------------------------------

 

<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

Posted by 사용자 icodebroker
TAG

댓글을 달아 주세요