开发者

Avoid a ListBox to be scrollable

开发者 https://www.devze.com 2023-01-23 23:27 出处:网络
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 t

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" />
0

精彩评论

暂无评论...
验证码 换一张
取 消