1

この写真のようにリストボックスをレイアウトする必要があります

ここに画像の説明を入力してください

私はリストボックスとlonglistselectorの両方でそれを行うためにすべてを試しました。

 <ListBox WP7Panels:DockPanel.Dock="Bottom" Name="MsgControlsList" 
                              ItemsSource="{Binding}" 
                              Height="600" 
                              HorizontalContentAlignment="Stretch"
                              VerticalAlignment="Bottom" VerticalContentAlignment="Bottom">
            <ListBox.Style>
                <Style TargetType="ListBox">
                    <Setter Property="VerticalAlignment"
            Value="Bottom" />
                    <Setter Property="VerticalContentAlignment"
            Value="Bottom" />
                </Style>
            </ListBox.Style>
            <ListBox.ItemTemplate>
            <DataTemplate>
                    <WP7Panels:DockPanel LastChildFill="True">
                        <HistoryClasses:HistoryElementTemplate WP7Panels:DockPanel.Dock="Bottom"  VerticalAlignment="Bottom" DataContext="{Binding}" HorizontalContentAlignment="Stretch"/>
                    </WP7Panels:DockPanel>
                </DataTemplate>
        </ListBox.ItemTemplate>
        <ListBox.ItemsPanel>
            <ItemsPanelTemplate>
                <toolkit:WrapPanel/>
            </ItemsPanelTemplate>
        </ListBox.ItemsPanel>
    </ListBox>
    </WP7Panels:DockPanel>    

..しかし、それでもリストボックスの上部の垂直方向の配置があります。

ここに画像の説明を入力してください

何か考えてください。

4

1 に答える 1

3

リストボックスの高さを設定しない場合、アイテムは画面の下部に表示されます。

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="600"/>
        <RowDefinition Height="Auto"/>
     </Grid.RowDefinitions>

     <TextBlock Text="Test"/>

     <ListBox Grid.Row="1"  VerticalAlignment="Bottom">
          <ListBox.ItemTemplate>
               <DataTemplate>
                    <TextBlock Text="Item"/>
               </DataTemplate>
           </ListBox.ItemTemplate>
      </ListBox>

      <TextBlock Grid.Row="2" Text="Test"/>

  </Grid>
于 2012-09-13T09:10:45.917 に答える