Question

I'm trying to use the LongListSelector to show a list of notes in my WP8 application. I use a list of Note (Note is my object name) and Note has two properties : Titre and Contenu. Simply, I want to display the Titre property of my object in my LongListSelector. I have this code : ListeNotes.ItemsSource = ListNotes (because ListNotes is my List's name and ListeNotes is my LongListSelector's name). But it shows a list containing only CloudyNote.Note the number of time I have notes. How could I do to show the Title property instead of the object name in my LongListSelector ? Thank you in advance.

Was it helpful?

Solution

Try to define ItemTemplate specifying which property to display :

<phone:LongListSelector>
    <phone:LongListSelector.ItemTemplate>
        <DataTemplate>
            <TextBlock Text="{Binding Titre}"/>
        </DataTemplate>
    </phone:LongListSelector.ItemTemplate>

    ...

<phone:LongListSelector/>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top