How to bind Data to ListBox in Windows Phone ?

The below code demonstrates a really simple way of binding data to the Standard ListBox in Windows Phone 7 using C# .

Assuming , you have the Class Movie as described below

public class Movie
   public string Actor { get; set; }
   public string Name { get; set; }


Create a List of Movie with the Data .

public class MovieList : List<Movie>
   public MovieList()
     Add(new Movie { Name = "Kaavalan", Actor = "Vijay", });
     Add(new Movie { Name = "Velayutham", Actor = "Vijay",  });
     Add(new Movie { Name = "7th Sense", Actor = "Surya",  });
     Add(new Movie { Name = "Billa 2", Actor = "Ajith Kumar",  });
     Add(new Movie { Name = "Nanban", Actor = "Vijay",  });


Now create the ListBox in the XAML page and add the ItemTemplate to the ListBox in Windows Phone along with a textbox to display the Name as described below

<ListBox Height="596" Name="listBox1" Width="380" >
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}"></TextBlock>

Now , assign the MovieList to the Listbox’s ItemSource Property

public MainPage()

private void FillListBox()
   listBox1.ItemsSource = new MovieList();

Run the Windows Phone Application by pressing F5 to launch the Windows Phone Emulator .


Download the Sample Code from

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Reply


Interesting BlogPosts to read

Download - Pokemon Go for for Windows 10 (Third Party app)
Pokemon Go is one of the popular AR games for android and iOS devices and now , the game is made ava...
Open Wordpad from command line in Windows
You can use the command "Write" from command line in Windows to open the WordPad application.D:\>...
Popular cross-platform (android and iOS) to-do list app
In this blog post, we will cover some of the popular to-do list app that is available on different p...