私はオブジェクト モデル、UserProfile を持っています。これには多くの ServiceProfile が含まれ、それぞれに多くの CommandProfile が含まれています。このモデルを Telerik WPF OutlookBar にバインドしました。
<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 は、ボタンのリストをコンテンツとして表示します。
単一のタブ (UserProfile を参照) 内で、ServiceProfile ごとに RibbonGroup を作成したいと考えています。各グループ (サービス プロファイル) 内には、CommandProfile ごとに 1 つずつ、多数のリボン ボタンがあります。しかし、私はできません。
このコードにたどり着きました:
<telerikRibbonBar:RadRibbonTab
x:Name="theTab"
Header="{Binding Description}"
Background="{Binding Color}"
ItemsSource="{Binding ServiceProfiles}">
</telerikRibbonBar:RadRibbonTab>
これによりリボングループが作成されますが、何も制御できません (グループのタイトル、(バインディングによる) コンテンツの入力)。
何か案が?
ありがとう
Marco Parenzan