■ LayoutPanel 클래스 : 도킹 패널에 바 내장하기

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


TestProject.zip


MainWindow.xaml

 

 

<Window x:Class="TestProject.MainWindow"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"

    xmlns:dxd="http://schemas.devexpress.com/winfx/2008/xaml/docking"

    Width="800"

    Height="600"

    Title="도킹 패널에 바 내장하기"

    FontFamily="나눔고딕코딩"

    FontSize="16">

    <Grid>

        <dxb:BarManager x:Name="barManager" CreateStandardLayout="True">

            <dxb:BarManager.Items>

                <dxb:BarButtonItem x:Name="cutBarButtonItem"   Content="Cut"   Glyph="pack://application:,,,/Image/cut16x16.png"   />

                <dxb:BarButtonItem x:Name="pasteBarButtonItem" Content="Paste" Glyph="pack://application:,,,/Image/paste16x16.png" />

                <dxb:BarButtonItem x:Name="undoBarButtonItem"  Content="Undo"  Glyph="pack://application:,,,/Image/undo16x16.png"  />

                <dxb:BarButtonItem x:Name="redoBarButtonItem"  Content="Redo"  Glyph="pack://application:,,,/Image/redo16x16.png"  />

                <dxb:BarButtonItem x:Name="exitBarButtonItem"  Content="Exit" />

                <dxb:BarSubItem    x:Name="fileBarSubItem"     Content="File">

                    <dxb:BarSubItem.ItemLinks>

                        <dxb:BarButtonItemLink BarItemName="exitBarButtonItem" />

                    </dxb:BarSubItem.ItemLinks>

                </dxb:BarSubItem>

            </dxb:BarManager.Items>

            <dxb:BarManager.Bars>

                <dxb:Bar x:Name="mainMenuBar"

                    IsMainMenu="True"

                    Caption="Main Menu">

                    <dxb:Bar.DockInfo>

                        <dxb:BarDockInfo ContainerType="Top" />

                    </dxb:Bar.DockInfo>

                    <dxb:Bar.ItemLinks>

                        <dxb:BarSubItemLink BarItemName="fileBarSubItem" />

                    </dxb:Bar.ItemLinks>

                </dxb:Bar>

                <dxb:Bar x:Name="bar1"

                    Caption="Bar 1">

                    <dxb:Bar.DockInfo>

                        <dxb:BarDockInfo ContainerName="toolboxLayoutPanelHeaderBarContainerControl" />

                    </dxb:Bar.DockInfo>

                    <dxb:Bar.ItemLinks>

                        <dxb:BarButtonItemLink BarItemName="cutBarButtonItem"   />

                        <dxb:BarButtonItemLink BarItemName="pasteBarButtonItem" />

                        <dxb:BarButtonItemLink BarItemName="undoBarButtonItem"  />

                        <dxb:BarButtonItemLink BarItemName="redoBarButtonItem"  />

                    </dxb:Bar.ItemLinks>

                </dxb:Bar>

            </dxb:BarManager.Bars>

            <dxd:DockLayoutManager Name="dockLayoutManager">

                <dxd:LayoutGroup Orientation="Horizontal">

                    <dxd:LayoutPanel x:Name="toolboxLayoutPanel"

                        HeaderBarContainerControlName="toolboxLayoutPanelHeaderBarContainerControl"

                        Caption="Toolbox">

                    </dxd:LayoutPanel>

                    <dxd:DocumentGroup>

                        <dxd:DocumentPanel x:Name="documentPanel" Caption="Document">

                            <RichTextBox />

                        </dxd:DocumentPanel>

                    </dxd:DocumentGroup>

                </dxd:LayoutGroup>

            </dxd:DockLayoutManager>

        </dxb:BarManager>

    </Grid>

</Window>

 


MainWindow.xaml.cs

 

 

using System.Windows;

 

namespace TestProject

{

    /// <summary>

    /// 메인 윈도우

    /// </summary>

    public partial class MainWindow : Window

    {

        //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor

        ////////////////////////////////////////////////////////////////////////////////////////// Public

 

        #region 생성자 - MainWindow()

 

        /// <summary>

        /// 생성자

        /// </summary>

        public MainWindow()

        {

            InitializeComponent();

        }

 

        #endregion

    }

}

 

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

Posted by 사용자 icodebroker
TAG

댓글을 달아 주세요