첨부 소스 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170

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>

 

728x90

 

▶ 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
    }
}
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요