Telerik WPF RibbonBar通过DataBinding填充

时间:2010-03-10 17:35:29

标签: wpf data-binding telerik ribbon recursive-databinding

我有和对象模型,一个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都会显示一个按钮列表作为内容。

我无法使用ribbonBar执行类似的工作:在单个选项卡(指我的UserProfile)中,我想为每个ServiceProfile创建一个RibbonGroup。在每个组(服务配置文件)中,有许多Ribbon按钮,每个CommandProfile一个。 但我不能。

我到达此代码:

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

            </telerikRibbonBar:RadRibbonTab>

创建了ribbongroups,但是我无法控制任何内容(组的标题,填充(通过Binding)内容。

有什么想法吗?

谢谢

Marco Parenzan

1 个答案:

答案 0 :(得分:0)

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

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

你好Alex Fan, 不幸的是,RibbonBar现在不支持数据绑定。但是,您可以在我们的PITS中对此功能进行投票,从而提高其优先级。 在您的情况下,如果以编程方式添加功能区项目,则最好。 如果您需要更多信息,请告诉我们。 祝一切顺利, 蒂娜斯坦切娃 Telerik团队
相关问题