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

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

    xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/core"

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

    Width="800"

    Height="600"

    Title="액션을 통한 패널의 컨텍스트 메뉴 커스텀 처리하기"

    FontFamily="나눔고딕코딩"

    FontSize="16">

    <Grid>

        <dxd:DockLayoutManager x:Name="dockLayoutManager"

            dxc:ThemeManager.ThemeName="Office2007Blue">

            <dxd:DockLayoutManager.ContextMenuCustomizations>

                <dxb:BarButtonItem x:Name="aboutBarButtonItem"

                    dxb:BarItemLinkActionBase.ItemLinkIndex="0"

                    CategoryName="Help"

                    Content="About"

                    ItemClick="aboutBarButtonItem_ItemClick" />

                <dxb:InsertBarItemLinkAction ItemLinkIndex="1">

                    <dxb:BarItemLinkSeparator />

                </dxb:InsertBarItemLinkAction>

            </dxd:DockLayoutManager.ContextMenuCustomizations>

            <dxd:LayoutGroup x:Name="rootLayoutGroup"

                Orientation="Horizontal">

                <dxd:LayoutPanel x:Name="propertyLayoutPanel"

                    Caption="Property"

                    ItemWidth="150">

                    <RichTextBox>

                        <FlowDocument>

                            <Paragraph>

                                <Run>Right-click the panel's caption to invoke a context menu</Run>

                            </Paragraph>

                        </FlowDocument>

                    </RichTextBox>

                </dxd:LayoutPanel>

                <dxd:DocumentPanel x:Name="documentPanel"

                    Caption="Document">

                    <RichTextBox />

                </dxd:DocumentPanel>

            </dxd:LayoutGroup>

        </dxd:DockLayoutManager>

    </Grid>

</Window>

 

 

MainWindow.xaml.cs

 

 

using System.Windows;

 

using DevExpress.Xpf.Bars;

 

namespace TestProject

{

    /// <summary>

    /// 메인 윈도우

    /// </summary>

    public partial class MainWindow : Window

    {

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

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

 

        #region 생성자 - MainWindow()

 

        /// <summary>

        /// 생성자

        /// </summary>

        public MainWindow()

        {

            InitializeComponent();

        }

 

        #endregion

 

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

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

 

        #region About 바 버튼 항목 항목 클릭시 처리하기 - aboutBarButtonItem_ItemClick(sender, e)

 

        /// <summary>

        /// About 바 버튼 항목 항목 클릭시 처리하기

        /// </summary>

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

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

        private void aboutBarButtonItem_ItemClick(object sender, ItemClickEventArgs e)

        {

            MessageBox.Show("About Window");

        }

 

        #endregion

    }

}

 

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

Posted by 사용자 icodebroker

댓글을 달아 주세요