我有和對象模型中,用戶配置,包含許多ServiceProfile,每個包含許多CommandProfile填充。 我已綁定這種模式與Telerik的WPF OutlookBar:Telerik的WPF RibbonBar通過數據綁定
<telerikNavigation:RadOutlookBar
ItemsSource="{Binding ServiceProfiles}"
Background="{Binding Color}">
<telerikNavigation:RadOutlookBar.TitleTemplate>
<DataTemplate>
<Label Content="{Binding Description}"/>
</DataTemplate>
</telerikNavigation:RadOutlookBar.TitleTemplate>
<telerikNavigation:RadOutlookBar.ItemTemplate>
<DataTemplate>
<Label Content="{Binding Description}"/>
</DataTemplate>
</telerikNavigation:RadOutlookBar.ItemTemplate>
<telerikNavigation:RadOutlookBar.ContentTemplate>
<DataTemplate>
<ListBox ItemsSource="{Binding CommandProfiles}" Background="Transparent">
<ListBox.ItemTemplate>
<DataTemplate>
<Button
Content="{Binding Description}"
Command="{Binding ExecuteCommand}"
/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</DataTemplate>
</telerikNavigation:RadOutlookBar.ContentTemplate>
</telerikNavigation:RadOutlookBar>
此XAML代碼創建的每個ServiceProfile一個OutlookbarItem。每個OutlookbarItem都提供一個按鈕列表作爲內容。
我不能與ribbonBar做類似的工作:一個標籤內(指我的用戶配置),我要爲每一個ServiceProfile一個RibbonGroup。在每個組(服務配置文件)內部都有許多Ribbon按鈕,每個CommandProfile都有一個按鈕。 但我不能。
我到達這個代碼:
<telerikRibbonBar:RadRibbonTab
x:Name="theTab"
Header="{Binding Description}"
Background="{Binding Color}"
ItemsSource="{Binding ServiceProfiles}">
</telerikRibbonBar:RadRibbonTab>
它創建ribbongroups,但我不能夠控制組的任何東西(頭銜,補(通過綁定)內容
所有。主意?
感謝
Marco Parenzan