2011-08-02 36 views
1

我試圖複製寫字板的Ribbon控件的樣式和功能。RibbonApplication Menu中的最近文檔是否爲按鈕?

RibbonApplicationMenu中,有一個MRU列表,顯示最近文檔的文件名。當我點擊文件名時,它會改變樣式並打開文檔。

什麼是控制文件名稱「test1」?它是一個RibbonButton嗎?一個ListBox?一個RibbonTextBox?有誰知道?

enter image description here

回答

1

這是你要認爲區域

內嘗試這個代碼,我張貼here什麼。希望它能清除東西

<Ribbon:Ribbon Grid.Row="0"> 
      <Ribbon:Ribbon.ApplicationMenu> 
       <Ribbon:RibbonApplicationMenu> 
        <Ribbon:RibbonApplicationMenu.AuxiliaryPaneContent> 
         <Grid MinHeight="500"> 
          <Grid.RowDefinitions> 
           <RowDefinition Height="30"/> 
           <RowDefinition Height="*"/> 
          </Grid.RowDefinitions> 
          <Border Grid.Row="0" BorderBrush="DarkBlue" BorderThickness="0,0,0,1"> 
           <StackPanel 
             Orientation="Vertical"> 
            <Label Foreground="DarkBlue" HorizontalAlignment="Left" VerticalAlignment="Center" HorizontalContentAlignment="Left" 
             VerticalContentAlignment="Center" Content="Hello World" /> 
           </StackPanel> 
          </Border> 
          <ListBox Grid.Row="1"> 
           <ListBoxItem>List Box Item 1</ListBoxItem> 
           <ListBoxItem>List Box Item 2</ListBoxItem> 
           <ListBoxItem>List Box Item 3</ListBoxItem> 
           <ListBoxItem>List Box Item 4</ListBoxItem> 
          </ListBox> 
         </Grid> 
        </Ribbon:RibbonApplicationMenu.AuxiliaryPaneContent> 
        <Ribbon:RibbonApplicationMenuItem Header="Hello _Ribbon" ImageSource="Images\LargeIcon.png"/> 
        <Ribbon:RibbonApplicationMenuItem Header="Hello _Ribbon" ImageSource="Images\LargeIcon.png"/> 
        <Ribbon:RibbonApplicationMenuItem Header="Hello _Ribbon" ImageSource="Images\LargeIcon.png"/> 
       </Ribbon:RibbonApplicationMenu> 

      </Ribbon:Ribbon.ApplicationMenu> 


     </Ribbon:Ribbon> 
+0

謝謝。但是裏面的內容是一個RibbonControl,因爲它繼承了RibbonControl樣式(黃色背景等),所以它不是一個ListBox,所以我關心的是.NET中可用的控件類型。或者是我必須從頭開始編寫的東西。 – KMC

+0

您可以探索Ribbon控件,它的源代碼可在http://wpf.codeplex.com/wikipage?title=WPF%20Ribbon%20Preview –