【问题标题】:listbox horizontal alignment wrap列表框水平对齐换行
【发布时间】:2013-07-25 07:04:46
【问题描述】:

如何在水平方向的列表框中的新行上开始项目?到目前为止,这是我的代码,但它提前显示了 1 行中的所有项目

<phone:PanoramaItem Header="Geklassifiseerd" Orientation="Horizontal" Foreground="Black">
            <ListBox x:Name="geklassifisseerd_list">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel>
                            <TextBlock Text="{Binding Name}" TextWrapping="Wrap" 
                                           Margin="10,0" 
                                           Foreground="Black"
                                           FontSize="20"
                                           />
                            <TextBlock Text="{Binding Date}" 
                                           TextWrapping="Wrap" 
                                           Foreground="Black"
                                           Margin="10,-2,10,0" 
                                           FontSize="20"
                                           />
                            <TextBlock Text="{Binding Image_uri}" 
                                           TextWrapping="Wrap" 
                                           Margin="10,-2,10,0" 
                                           Foreground="Black"
                                          />
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>

                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Horizontal"/>
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>

            </ListBox>

【问题讨论】:

    标签: xaml listbox panorama-control itemspanel


    【解决方案1】:

    得到答案,我在 itemspanetemplate 中使用了包装面板,导致程序集发生冲突,我通过 nugget 重新安装 Microsoft.phhone.controls 程序集解决了这个问题

                   <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <Controls:WrapPanel Orientation="Horizontal" />
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-28
      • 1970-01-01
      • 2022-01-26
      • 1970-01-01
      • 2012-06-04
      • 1970-01-01
      相关资源
      最近更新 更多