0

我有一个对象模型,一个 UserProfile,它包含许多 ServiceProfile,每个 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 将按钮列表作为内容呈现。

我无法使用ribbonBar 完成类似的工作:在单个选项卡内(参考我的UserProfile),我想为每个ServiceProfile 创建一个RibbonGroup。在每个组(服务配置文件)内有许多功能区按钮,每个命令配置文件一个。但我做不到。

我到达这个代码:

 <telerikRibbonBar:RadRibbonTab 
                x:Name="theTab"
                Header="{Binding Description}" 
                Background="{Binding Color}"
                ItemsSource="{Binding ServiceProfiles}">

            </telerikRibbonBar:RadRibbonTab>

它创建了ribbongroups,但我无法控制任何东西(组的标题,填充(通过绑定)内容。

任何想法?

谢谢

Marco Parenzan
4

1 回答 1

0

有点晚了,但很遗憾地说,但它看起来还不支持:

http://www.telerik.com/community/forums/silverlight/ribbonbar/headertemplate-of-radribbontab.aspx

你好 Alex Fan,不幸的是 RibbonBar 目前不支持数据绑定。但是,您可以在我们的 PITS 中投票支持此功能,从而提高其优先级。在您的情况下,最好以编程方式添加功能区项目。如果您需要更多信息,请告诉我们。一切顺利,Tina Stancheva Telerik 团队
于 2010-06-25T11:15:53.940 回答