Windows应用商店应用程序,Listview Groupheaderplacement左右滚动 [英] Windows Store app, Listview Groupheaderplacement Left and vertical scrolling

查看:73
本文介绍了Windows应用商店应用程序,Listview Groupheaderplacement左右滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我在GroupHeaderPlacement和Vertical滚动方面遇到了问题. 我试图达到的目的是:

So I'm having a issue with GroupHeaderPlacement and Vertical scrolling. What Im trying to achieve is this:

但是由于某些原因,我的小组却按照水平滚动的方向进行排列.任何人都知道我是否在这里缺少明显的东西,或者如果您有GroupHeaderPlacement Left,那么您是否不能简单地进行垂直滚动Listview.

But for some reason my groups are getting arranged in a horisontal scrolling direction. Anyone know if I'm missing something obvious here or if you simple can't have a vertical scrolling Listview if you have GroupHeaderPlacement Left.

代码为:<ListView x:Name="ItemsGridView" Margin="118,-5,0,0" ItemsSource="{Binding Source={StaticResource AllCurrentGroup}}" SelectionMode="Single" Grid.Row="2" Grid.Column="0" ShowsScrollingPlaceholders="False" SelectionChanged="SelectedPresentationItem_SelectionChanged" IsSwipeEnabled="True"> <ListView.ItemsPanel> <ItemsPanelTemplate> <ItemsWrapGrid GroupHeaderPlacement="Left" Orientation="Vertical" /> </ItemsPanelTemplate> </ListView.ItemsPanel> <ListView.ItemTemplate> <DataTemplate> <StackPanel Grid.Column="1" Height="80" Margin="40,0,0,0" > <TextBlock Text="{Binding Tid }" Style="{StaticResource BodyTextBlockStyle}" Grid.Column="1" > <TextBlock.Foreground> <SolidColorBrush Color="{StaticResource Orange}"/> </TextBlock.Foreground> </TextBlock> <TextBlock Text="{Binding Titel }" Style="{StaticResource SubheaderTextBlockStyle}" Grid.Column="1" /> </StackPanel> </DataTemplate> </ListView.ItemTemplate> <ListView.GroupStyle> <GroupStyle> <GroupStyle.HeaderTemplate> <DataTemplate> <StackPanel Grid.Column="0" Grid.RowSpan="{Binding Rows}" Width="160" Height="200"> <StackPanel.Background> <SolidColorBrush Color="{StaticResource BlueDark}"/> </StackPanel.Background> <TextBlock Text="{Binding Vecka, Converter={StaticResource ToWeekString }}" Style="{StaticResource BodyTextBlockStyle}" Foreground="#FFFFFFFF" HorizontalAlignment="Left" VerticalAlignment="Top" FontFamily="Global User Interface" Margin="20,13,0,0"/> <TextBlock Text="{Binding Datum, Converter={StaticResource ToDayNumber }}" Style="{StaticResource HeaderTextBlockStyle}" Foreground="#FFFFFFFF" HorizontalAlignment="Left" Margin="20,26,0,0"/> <TextBlock Text="{Binding Datum, Converter={StaticResource ToMonth }}" Style="{StaticResource SubheaderTextBlockStyle}" Foreground="#FFFFFFFF" HorizontalAlignment="Left" VerticalAlignment="Top" FontFamily="Global User Interface" Margin="20,-3,0,0"/> <TextBlock Text="{Binding Datum, Converter={StaticResource ToDayString }}" Style="{StaticResource BodyTextBlockStyle}" Foreground="#FFFFFFFF" HorizontalAlignment="Left" VerticalAlignment="Top" FontFamily="Global User Interface" Margin="20,13,0,0"/> </StackPanel> </DataTemplate> </GroupStyle.HeaderTemplate> <GroupStyle.Panel> <ItemsPanelTemplate> <WrapGrid Orientation="Vertical"></WrapGrid> </ItemsPanelTemplate> </GroupStyle.Panel> </GroupStyle> </ListView.GroupStyle> </ListView>

The Code is:<ListView x:Name="ItemsGridView" Margin="118,-5,0,0" ItemsSource="{Binding Source={StaticResource AllCurrentGroup}}" SelectionMode="Single" Grid.Row="2" Grid.Column="0" ShowsScrollingPlaceholders="False" SelectionChanged="SelectedPresentationItem_SelectionChanged" IsSwipeEnabled="True"> <ListView.ItemsPanel> <ItemsPanelTemplate> <ItemsWrapGrid GroupHeaderPlacement="Left" Orientation="Vertical" /> </ItemsPanelTemplate> </ListView.ItemsPanel> <ListView.ItemTemplate> <DataTemplate> <StackPanel Grid.Column="1" Height="80" Margin="40,0,0,0" > <TextBlock Text="{Binding Tid }" Style="{StaticResource BodyTextBlockStyle}" Grid.Column="1" > <TextBlock.Foreground> <SolidColorBrush Color="{StaticResource Orange}"/> </TextBlock.Foreground> </TextBlock> <TextBlock Text="{Binding Titel }" Style="{StaticResource SubheaderTextBlockStyle}" Grid.Column="1" /> </StackPanel> </DataTemplate> </ListView.ItemTemplate> <ListView.GroupStyle> <GroupStyle> <GroupStyle.HeaderTemplate> <DataTemplate> <StackPanel Grid.Column="0" Grid.RowSpan="{Binding Rows}" Width="160" Height="200"> <StackPanel.Background> <SolidColorBrush Color="{StaticResource BlueDark}"/> </StackPanel.Background> <TextBlock Text="{Binding Vecka, Converter={StaticResource ToWeekString }}" Style="{StaticResource BodyTextBlockStyle}" Foreground="#FFFFFFFF" HorizontalAlignment="Left" VerticalAlignment="Top" FontFamily="Global User Interface" Margin="20,13,0,0"/> <TextBlock Text="{Binding Datum, Converter={StaticResource ToDayNumber }}" Style="{StaticResource HeaderTextBlockStyle}" Foreground="#FFFFFFFF" HorizontalAlignment="Left" Margin="20,26,0,0"/> <TextBlock Text="{Binding Datum, Converter={StaticResource ToMonth }}" Style="{StaticResource SubheaderTextBlockStyle}" Foreground="#FFFFFFFF" HorizontalAlignment="Left" VerticalAlignment="Top" FontFamily="Global User Interface" Margin="20,-3,0,0"/> <TextBlock Text="{Binding Datum, Converter={StaticResource ToDayString }}" Style="{StaticResource BodyTextBlockStyle}" Foreground="#FFFFFFFF" HorizontalAlignment="Left" VerticalAlignment="Top" FontFamily="Global User Interface" Margin="20,13,0,0"/> </StackPanel> </DataTemplate> </GroupStyle.HeaderTemplate> <GroupStyle.Panel> <ItemsPanelTemplate> <WrapGrid Orientation="Vertical"></WrapGrid> </ItemsPanelTemplate> </GroupStyle.Panel> </GroupStyle> </ListView.GroupStyle> </ListView>

推荐答案

http://code.msdn.microsoft.com/windowsapps/GroupedGridView-77c59e8e/sourcecode?fileId=44751&pathId=298223712

请参考上面的示例链接,该链接可帮助您实现要求.

Please refer the above sample link which helps you to achieve your req.

这篇关于Windows应用商店应用程序,Listview Groupheaderplacement左右滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆