1

i like to customize my LongListSelector or ListBox in my own way so can any one help me to design it..
MY Code..

<StackPanel HorizontalAlignment="Left" Height="345" Margin="10,234,0,0" VerticalAlignment="Top" Width="413">
                <phone:LongListSelector x:Name="list_organization" Height="340" Margin="10,0"/>

</StackPanel>

This is my code to bind the long list..

org = await client.searchOrganization(txtQuery.Text);
            if (org != null)
            {
                var query = from c in org
                            select new { c.name,c.id,c.time,.. };
                list_organization.ItemsSource = query.ToList();//bind the query to longlist
            }

i want like this design page..

enter image description here

how to do it...?

4

1 回答 1

1

首先,删除明确的宽度和高度。如果你只有一个LongListSelector里面的StackPanel,你可以删除StackPanel

类似列表框的容器的单个项目是通过使用DataTemplateto replace来完成的ItemTemplate。查看以下 MSDN 链接以获取更多信息:ListBox Styles and Templates

基本上,这是你如何做到的:

<phone:LongListSelector x:Name="list_organization" Height="340" Margin="10,0"
                        ItemsSource="{Binding People}">
    <phone:LongListSelector.ItemTemplate>
        <DataTemplate>
            <!-- your XAML for individual item goes here -->
            <TextBlock Text="{Binding FirstName}" />
        </DataTemplate>
    </phone:LongListSelector.ItemTemplate>
</phone:LongListSelector>
于 2013-11-13T10:18:55.523 回答