c# - 水平ScrollViewer列表 - WP8

标签 c# windows-phone-8 windows-phone scrollviewer

我正在尝试在 Windows Phone 8 项目上实现此目标: Rought sketch

我想要有许多行填充元素(在本例中为图像),我可以水平滚动这些元素,能够单击它们并导航到新页面,除此之外,我希望该列表可垂直滚动

例如,我会向下滚动直到看到第 10 行,然后在第 10 行我会向右滚动直到看到图像 8,当我按下它时,我会导航到另一个页面。

如果有人能给我一些关于如何实现这一点的线索,我将不胜感激

最佳答案

也许这会对你有帮助。将 Scrollviewer 放入具有水平 scrollBarVisibilityListBox 数据模板中。

    <ListBox  Grid.Row="1"  Name="listBoxClient">
       <ListBox.ItemTemplate>
         <DataTemplate>
            <ScrollViewer VerticalAlignment="Top" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled" Width ="400">
<StackPanel Orientation="Horizontal">
            <Image Source="{Binding YourImageSource}" Width="YourWidth" Height="YourHeight" Tap="Iamge_Tap"/>
</StackPanel>
            </ScrollViewer>
          </DataTemplate>
         </ListBox.ItemTemplate>
    </ListBox>

在代码后面

private void Iamge_Tap(object sender, System.Windows.Input.GestureEventArgs e)
    {
      NavigationService.Navigate(new Uri("Your page path",UriKind.Relative));
    }

关于c# - 水平ScrollViewer列表 - WP8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21321831/

相关文章:

c# - 使用(而非滥用)ContinueWith

javascript - JavaScript 中的本地文件支持检测 - Windows Phone 8 Bug

MVVM Windows Phone 8 - 向 map 添加图钉集合

visual-c++ - Windows Phone 8 RunTimeComponent 中的错误 “signature of public member contains native type”

c# - Windows Phone 7 下载版本

c# - 将包含检查为空属性的 int 数组

c# - 阻塞全局迭代器有意义吗?

c# - 如何在C#中将巨大的JSON文件转换为xml文件

c# - 如何以编程方式提取应用名称和版本号?

c++ - FreeType 链接问题