SemanticZoom ZoomedOutView SelectedItems返回DependencyObject的ZoomedOutView、SemanticZoom、DependencyObje

2023-09-04 04:11:45 作者:穷追i

在SemanticZoom控制我用同样的 Col​​lectionViewSource 同时为放大和缩小视图。要做到这一点,我绑定缩小的GridView 在code的背后是这样的:

In the SemanticZoom control I use the same CollectionViewSource for both the zoomed in and zoomed out view. To do this I bind the zoomed out GridView in the code behind like this:

(FavoriteGroupsSemanticZoom.ZoomedOutView as ListViewBase).ItemsSource = this.FavoriteGroupsViewSource.View.CollectionGroups;

一切按预期工作。不过,现在的缩小GridView控件绑定到DependencyObjects,而不是我原来的组的列表。就这样,当我访问SelectedItems我得到一个包含DependencyObjects,而不是我的组列表的WinRT的对象。

Everything works as expected. However, now the zoomed out GridView is bound to a list of DependencyObjects instead of my original groups. And thus when I access the SelectedItems I get a WinRT object that contains a list of DependencyObjects instead of my groups.

我如何可以访问选定组的缩小的GridView的?

How can I access the selected groups of the zoomed out GridView?

推荐答案

您投的依赖对象到 ICollectionViewGroup 具有属性的集团和 GroupItems 的。

You cast the Dependency Object to an ICollectionViewGroup which has the properties Group and GroupItems.