功能区样本

时间:2009-07-07 22:14:38

标签: wpf office-2007 ribbon

我正在使用Microsoft的WPF功能区CTP。 但是,没有样本。我不知道从哪里开始。 RibbonWindow没有Ribbon的属性。有没有人有一个有效的样本?

2 个答案:

答案 0 :(得分:12)

This is a great tutorial!从头开始,涵盖许多细节!如果您一步一步地为初学者提供最佳教程。

如果您使用Fluent功能区,则new documentation on their website

答案 1 :(得分:1)

如果您正在使用WPF功能区 http://msdn.microsoft.com/en-us/library/ff799534(v=vs.100).aspx

MSDN文档提供了有关如何使用每个组件的很好示例。

http://msdn.microsoft.com/en-us/library/microsoft.windows.controls.ribbon(v=vs.100).aspx

<r:RibbonWindow
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:r="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
        x:Class="MainWindowView"
        Title="MainWindowView" Height="300" Width="515">
    <DockPanel>
        <r:Ribbon DockPanel.Dock="Top">
        <r:RibbonTab x:Name="tab1" Header="Tab1">
            <r:RibbonGroup Header="Group1">
                <r:RibbonButton x:Name="button1" Label="Button 1" LargeImageSource="/Images/button1.png" />
                <r:RibbonButton x:Name="button2" Label="Button 2" LargeImageSource="/Images/button2.png"/>
                <r:RibbonButton x:Name="button3" Label="Button 3" LargeImageSource="/Images/Button3.png"/>
            </r:RibbonGroup>
            <r:RibbonGroup Header="Group2">
                <r:RibbonButton x:Name="button4" Label="Button 4" LargeImageSource="/Images/button4.png"/>
            </r:RibbonGroup>
            <r:RibbonGroup Header="Group 3">
                <r:RibbonMenuButton Label="Button 5" LargeImageSource="/Images/button5.png" >
                    <r:RibbonButton x:Name="button6" Label="Button 6" SmallImageSource="/Images/button6.png"/>
                </r:RibbonMenuButton>
                <r:RibbonMenuButton Label="Button 7" LargeImageSource="/Images/button7.png" >
                    <r:RibbonButton x:Name="button8" Label="Button 8" />
                </r:RibbonMenuButton>
            </r:RibbonGroup>
        </r:RibbonTab>
    </r:Ribbon>
    </DockPanel>
</r:RibbonWindow>

唯一的问题是你需要更新你的视图以继承RibbonWindow而不是Window。

相关问题