Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/308.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# ListPicker中的ImageTile显示不正确_C#_Wpf_Xaml_Windows Phone_Listpicker - Fatal编程技术网

C# ListPicker中的ImageTile显示不正确

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

我正在尝试在ListPicker中显示互动程序。这意味着,当用户单击ListPicker时,应该会弹出如下平铺:

资料来源:

我的问题是,我想有两列,就像在图片中一样,但我的图像总是显示在彼此下面,而不是两个相邻的图像。所以现在看起来是这样的:

这是我的xaml代码:

<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>