Using full container width for ListBoxItem

A couple of days ago I was building a ListBox for a wp7 app which required the ListBoxItems to use the full width of the container. I tried to apply some of my WPF knowledge to fix the problem, using HorizontalAlignment=”Stretch” but to no avail. It took me ages to find a work around & I ended up using fixed width’s. For now, a fixed width solution is okay in portrait mode, but if I wanted the app to support both orientations, I would need a better solution.

This morning I stumbled across this post which explains that there is a bug in the coding for the WP7 Silverlight ListBox and the correct XAML code to fix it. Click the link below to read the full article.

Full Article: Timdam’s blog