■ DockLayoutManager 클래스 : 코드로 레이아웃 항목 이동하기

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


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:dxd="http://schemas.devexpress.com/winfx/2008/xaml/docking"

    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"

    Width="800"

    Height="600"

    Title="코드로 레이아웃 항목 이동하기"

    FontFamily="나눔고딕코딩"

    FontSize="16">

    <dxd:DockLayoutManager x:Name="dockLayoutManager">

        <dxd:DockLayoutManager.LayoutRoot>

            <dxd:LayoutGroup x:Name="rootLayoutGroup"

                Orientation="Vertical">

                <dxd:LayoutControlItem>

                    <Button x:Name="moveButton"

                        Content="Click to move item"

                        Click="moveButton_Click" />

                </dxd:LayoutControlItem>

                <dxd:LayoutControlItem x:Name="buttonLayoutControlItem">

                    <Button x:Name="button1"

                        Content="Button 1" />

                </dxd:LayoutControlItem>

                <dxd:LayoutControlItem x:Name="buttonEditLayoutControlItem">

                    <dxe:ButtonEdit x:Name="buttonEdit"

                        Text="(555) 123 45 67 89" />

                </dxd:LayoutControlItem>

            </dxd:LayoutGroup>

        </dxd:DockLayoutManager.LayoutRoot>

    </dxd:DockLayoutManager>

</Window>

 

 

MainWindow.xaml.cs

 

 

using System.Windows;

 

using DevExpress.Xpf.Layout.Core;

 

namespace TestProject

{

    /// <summary>

    /// 메인 윈도우

    /// </summary>

    public partial class MainWindow : Window

    {

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

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

 

        #region 생성자 - MainWindow()

 

        /// <summary>

        /// 생성자

        /// </summary>

        public MainWindow()

        {

            InitializeComponent();

        }

 

        #endregion

 

        //////////////////////////////////////////////////////////////////////////////////////////////////// Method

        ////////////////////////////////////////////////////////////////////////////////////////// Private

 

        #region Move 버튼 클릭시 처리하기 - moveButton_Click(sender, e)

 

        /// <summary>

        /// Move 버튼 클릭시 처리하기

        /// </summary>

        /// <param name="sender">이벤트 발생자</param>

        /// <param name="e">이벤트 인자</param>

        private void moveButton_Click(object sender, RoutedEventArgs e)

        {

            this.dockLayoutManager.LayoutController.Move(this.buttonEditLayoutControlItem, this.buttonLayoutControlItem, MoveType.Left);

        }

 

        #endregion

    }

}

 

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

Posted by 사용자 icodebroker
TAG

댓글을 달아 주세요