첨부 소스 코드는 나눔고딕코딩 폰트를 사용합니다.
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:dxr="http://schemas.devexpress.com/winfx/2008/xaml/ribbon"
    xmlns:dxre="http://schemas.devexpress.com/winfx/2008/xaml/richedit"
    Width="800"
    Height="600"
    Title="RichEditControl을 위한 리본 UI 제공하기"
    FontFamily="나눔고딕코딩"
    FontSize="16">
    <Window.Resources>
        <ResourceDictionary>
            <dxre:RichEditUICommand x:Key="RichEditUICommandKey" />
        </ResourceDictionary>
    </Window.Resources>
    <Grid>
        <dxb:BarManager x:Name="barManager"
            ToolbarGlyphSize="Small">
            <dxb:BarManager.Items>
                <dxb:BarButtonItem x:Name="fileNewBarButtonItem"
                    Command="{Binding Path=FileNew, Mode=OneTime, Source={StaticResource RichEditUICommandKey}}"
                    CommandParameter="{Binding ElementName=richEditControl}" />
                <dxb:BarButtonItem x:Name="fileOpenBarButtonItem"
                    Command="{Binding Path=FileOpen, Mode=OneTime, Source={StaticResource RichEditUICommandKey}}"
                    CommandParameter="{Binding ElementName=richEditControl}" />
                <dxb:BarButtonItem x:Name="fileSaveAsBarButtonItem"
                    Command="{Binding Path=FileSaveAs, Mode=OneTime, Source={StaticResource RichEditUICommandKey}}"
                    CommandParameter="{Binding ElementName=richEditControl}" />
                <dxb:BarButtonItem x:Name="filePrintBarButtonItem"
                    Command="{Binding Path=FilePrint, Mode=OneTime, Source={StaticResource RichEditUICommandKey}}"
                    CommandParameter="{Binding ElementName=richEditControl}" />
                <dxb:BarButtonItem x:Name="filePrintPreviewBarButtonItem"
                    Command="{Binding Path=FilePrintPreview, Mode=OneTime, Source={StaticResource RichEditUICommandKey}}"
                    CommandParameter="{Binding ElementName=richEditControl}" />
                <dxb:BarButtonItem x:Name="editUndoBarButtonItem"
                    Command="{Binding Path=EditUndo, Mode=OneTime, Source={StaticResource RichEditUICommandKey}}"
                    CommandParameter="{Binding ElementName=richEditControl}" />
                <dxb:BarButtonItem x:Name="editRedoBarButtonItem"
                    Command="{Binding Path=EditRedo, Mode=OneTime, Source={StaticResource RichEditUICommandKey}}"
                    CommandParameter="{Binding ElementName=richEditControl}" />
            </dxb:BarManager.Items>
            <DockPanel>
                <dxr:RibbonControl DockPanel.Dock="Top">
                    <dxr:RibbonDefaultPageCategory>
                        <dxr:RibbonPage x:Name="fileRibbonPage"
                            Caption="File">
                            <dxr:RibbonPageGroup x:Name="commonRibbonPageGroup"
                                Caption="Common">
                                <dxb:BarButtonItemLink BarItemName="fileNewBarButtonItem"          />
                                <dxb:BarButtonItemLink BarItemName="fileOpenBarButtonItem"         />
                                <dxb:BarButtonItemLink BarItemName="fileSaveAsBarButtonItem"       />
                                <dxb:BarButtonItemLink BarItemName="filePrintBarButtonItem"        />
                                <dxb:BarButtonItemLink BarItemName="filePrintPreviewBarButtonItem" />
                                <dxb:BarButtonItemLink BarItemName="editUndoBarButtonItem"         />
                                <dxb:BarButtonItemLink BarItemName="editRedoBarButtonItem"         />
                            </dxr:RibbonPageGroup>
                        </dxr:RibbonPage>
                    </dxr:RibbonDefaultPageCategory>
                </dxr:RibbonControl>
                <dxre:RichEditControl x:Name="richEditControl" 
                    BarManager="{Binding ElementName=barManager, Mode=OneTime}" />
            </DockPanel>
        </dxb:BarManager>
    </Grid>
</Window>
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요