UWP SemanticZoom组绑定

问题描述 投票:1回答:1

我已经被困了好几天了,因为我找不到将CollectionViewSource绑定到SemanticZoom控件(Windows 10应用程序)的方法。

我做了很多,数据显示在ZoomedIn视图中。但我只是不知道还有什么可以尝试将组绑定到ZoomedOut视图。它根本不起作用。我甚至做了一个虚拟转换器来查看哪种数据到达数据模板。但它有点无用,因为它是'DependencyObject'而我甚至无法将其转换为我的对象。

谁能帮帮我吗?

附:另外一个信息:我在一个单独的ResourceDictionary中设置我的SemanticZoom控件样式,它看起来像这样:

<GridView.ItemTemplate>
    <DataTemplate>
        <Border Height="48"
                Width="144"
                Background="Green"
                BorderThickness="1">
            <ToolTipService.ToolTip>
                <TextBox Text="{Binding Converter={StaticResource DoNothing}}"
                         TextWrapping="Wrap"/>
            </ToolTipService.ToolTip>
            <TextBlock Text="{Binding Converter={StaticResource DoNothing}}"
                       Foreground="Yellow"
                       HorizontalAlignment="Center"
                       VerticalAlignment="Center" />
        </Border>
    </DataTemplate>
</GridView.ItemTemplate>
binding win-universal-app
1个回答
1
投票

在Microsoft UWP示例的GitHub上有一个很好的例子。

正在使用的给定页面:https://github.com/Microsoft/Windows-universal-samples/blob/5c66da8b7552ad8c3bd665cfad595c7d0bb47059/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/SemanticZoomPage.xaml

您需要下载的项目来试驾它:https://github.com/Microsoft/Windows-universal-samples/tree/5c66da8b7552ad8c3bd665cfad595c7d0bb47059/Samples/XamlUIBasics

看一看,然后尝试在代码中跟踪出错的地方。

© www.soinside.com 2019 - 2024. All rights reserved.