数据绑定 RibbonTab 正在“标题”中显示 RibbonGroup 内容
我有一个“RibbonGroupViewModel”的可观察集合。
每个 viewModel 的视图定义如下:
<DataTemplate DataType="{x:Type vm:RibbonGroupViewModel}">
<ribbon:RibbonGroup Header="test">
//....
</ribbon:RibbonGroup >
</DataTemplate>
并显示功能区:
<ribbon:RibbonTab Header="Home">
<ribbon:RibbonGroup Header="Client">
<ribbon:RibbonCheckBox Label="bouton2"></ribbon:RibbonCheckBox>
</ribbon:RibbonGroup>
<ItemsControl ItemsSource="{Binding RibbonGroupCollection}"></ItemsControl>
</ribbon:RibbonTab>
新的功能区组已添加到我的功能区,但显示不正确......
参见 ScreenShot
http://img8.imageshack.us/img8/8584/screenshot300d.jpg
第二组处于“其他”级别...非常奇怪
仅供参考,如果我不使用 ItemTemplate(第一个 RibbonGroup),一切都可以
I have an observableCollection of "RibbonGroupViewModel".
The view of each viewModel is defined like that :
<DataTemplate DataType="{x:Type vm:RibbonGroupViewModel}">
<ribbon:RibbonGroup Header="test">
//....
</ribbon:RibbonGroup >
</DataTemplate>
And to display Ribbon :
<ribbon:RibbonTab Header="Home">
<ribbon:RibbonGroup Header="Client">
<ribbon:RibbonCheckBox Label="bouton2"></ribbon:RibbonCheckBox>
</ribbon:RibbonGroup>
<ItemsControl ItemsSource="{Binding RibbonGroupCollection}"></ItemsControl>
</ribbon:RibbonTab>
THe new RibbonGroup is added to my ribbon but the display is not correct....
See ScreenShot
http://img8.imageshack.us/img8/8584/screenshot300d.jpg
the second group is in "other" level... very strange
Just for information, if I don't use ItemTemplate (first RibbonGroup), all is ok
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题可能是,ItemsControl 不只是插入一堆 RibbonGroup,而是将它们包装在 StackPanel 中。
如果是这样,您可以将“Client”组添加到 RibbonGroupCollection 并绑定到 RibbonTab 的 ItemsSource 属性。
The problem could be, that ItemsControl does not just inserts a bunch of RibbonGroups, but wraps them in a StackPanel.
If thats it, you could add your "Client" group to the RibbonGroupCollection and bind to the ItemsSource property of the RibbonTab.