Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Having put the code that you've shown so far in a sample project I don't have the problems that you describe with scrolling, so I assume that there are other elements ont he page along with the <code>ListBox</code> that are affecting the layout and hence the scrolling.</p> <p>As mentioned above, the problem with the orientation change was to do with fixed width elements, which you can resolve using star width columns as discussed in <a href="http://windowsteamblog.com/windows_phone/b/wpdev/archive/2010/04/08/automatic-rotation-support-or-automatic-multi-orientation-layout-support-for-windows-phone.aspx" rel="nofollow">Automatic Rotation Support or Automatic Multi-Orientation Layout Support for Windows Phone</a> ont he Windows Phone Developer Blog.</p> <p>One other point worth making is that unless you actually have some logic related to this items that you have created the <code>listbox_item</code> <code>UserControl</code> for, you can implement the layout by specifying the <code>ItemTemplate</code> property of the <code>ListBox</code>, and then you can simply create a list of data objects and bind them to the <code>ItemsSource</code> property. E.g.</p> <pre><code>&lt;ListBox x:Name="Index_list" HorizontalContentAlignment="Stretch" Margin="0,78,0,0" SelectionChanged="on_selection" VerticalContentAlignment="Top"&gt; &lt;ListBox.ItemTemplate&gt; &lt;DataTemplate&gt; &lt;Grid Background="{StaticResource PhoneChromeBrush}"&gt; &lt;!-- Column definitions here. --&gt; &lt;TextBlock Height="30" HorizontalAlignment="Left" Text="{Binding Label}" VerticalAlignment="Top" /&gt; &lt;Image Height="34" HorizontalAlignment="Right" Margin="0,6,55,0" Source="{Binding ImagePath}" Stretch="Uniform" VerticalAlignment="Top" Width="66" /&gt; &lt;Line Height="10" HorizontalAlignment="Stretch" Margin="0,38,0,0" Stroke="White" StrokeThickness="2" VerticalAlignment="Top" Stretch="Fill" Fill="#FFF5E9E9" /&gt; &lt;/Grid&gt; &lt;/DataTemplate&gt; &lt;/ListBox.ItemTemplate&gt; &lt;/ListBox&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload