C# ListPicker中的ImageTile显示不正确
我正在尝试在ListPicker中显示互动程序。这意味着,当用户单击ListPicker时,应该会弹出如下平铺: 资料来源: 我的问题是,我想有两列,就像在图片中一样,但我的图像总是显示在彼此下面,而不是两个相邻的图像。所以现在看起来是这样的: 这是我的xaml代码:C# ListPicker中的ImageTile显示不正确,c#,wpf,xaml,windows-phone,listpicker,C#,Wpf,Xaml,Windows Phone,Listpicker,我正在尝试在ListPicker中显示互动程序。这意味着,当用户单击ListPicker时,应该会弹出如下平铺: 资料来源: 我的问题是,我想有两列,就像在图片中一样,但我的图像总是显示在彼此下面,而不是两个相邻的图像。所以现在看起来是这样的: 这是我的xaml代码: <phone:PhoneApplicationPage.Resources> <model:Bundesland x:Key="Bundesland"/> <DataTemplat
<phone:PhoneApplicationPage.Resources>
<model:Bundesland x:Key="Bundesland"/>
<DataTemplate x:Name="PickerFullItemTemplateBundesland">
<coding4fun:Tile Background="Transparent" >
<coding4fun:Tile.Content>
<StackPanel>
<Image Source="{Binding Flagge, Mode=TwoWay}" Height="200" />
<TextBlock Text="{Binding Land}" FontSize="25"/>
</StackPanel>
</coding4fun:Tile.Content>
</coding4fun:Tile>
<!--<TextBlock Grid.Column="2" Text="{Binding Land}" FontSize="25"/>-->
</DataTemplate>
</phone:PhoneApplicationPage.Resources>
<tool:ListPicker ItemsSource="{Binding BundeslandListe, Mode=TwoWay}" SelectedItem="{Binding Bundesland, Mode=TwoWay}" ExpansionMode="FullScreenOnly" FullModeItemTemplate="{StaticResource PickerFullItemTemplateBundesland}"/>
我也尝试过使用ImageTile和MetroFlow,但仍然不起作用。这是因为我可以在Listpicker中只显示彼此下面的项目,而不显示彼此旁边的项目吗?在您提到的博客中,作者使用WP toolkit中的
包装面板覆盖默认的ListBox的ItemPanelTemplate来实现这两列的外观:
<ListBox ItemsSource="{StaticResource Notes}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<toolkit:WrapPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox ItemsSource="{StaticResource Notes}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<toolkit:WrapPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<toolkit:ListPicker>
<toolkit:ListPicker.ItemsPanel>
<ItemsPanelTemplate>
<toolkit:WrapPanel/>
</ItemsPanelTemplate>
</toolkit:ListPicker.ItemsPanel>
</toolkit:ListPicker>