Avoid a ListBox to be scrollable
I have a ListBox so I can use bindings. I'm new to Silverlight so maybe there is another way. I just want to display a list of items in a template. I don't need it to be scollable, because it fits the screen. Here is ma code :
<ListBox Margin="0,0,-12,0" ItemsSource="{Binding NewSearchItems}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Margin="0,0,0,0" Width="440">
<TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle2Style}"/>
<TextBlock Text="{Binding LineTwo}" TextWrapping="Wrap" Style="{StaticResource PhoneTextAccentStyle}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
开发者_JAVA百科 </ListBox>
Thanks,
In XAML:
<ListBox ScrollViewer.VerticalScrollBarVisibility="Disabled" />
精彩评论