Чтобы в Silverlight приложении для Windows Phone сделать ListBox програчным, например, для того, чтобы список отображался на фоне иллюстрации, в XAML файл страницы, содержащейListBox, надо добавить объявление стиля для ListBox (за прозрачность отвечает параметр Backgroundузла ScrollViever) и затем указать этот стиль в качестве значения параметра Style.
Пример объявлени стиля:
<Style x:Key="ListBoxStyle1" TargetType="ListBox">
<SetterProperty="Background" Value="Transparent"/>
<SetterProperty="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
<SetterProperty="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
<SetterProperty="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
<SetterProperty="BorderThickness" Value="0"/>
<SetterProperty="BorderBrush" Value="Transparent"/>
<SetterProperty="Padding" Value="0"/>
<SetterProperty="Template">
<Setter.Value>
<ControlTemplateTargetType="ListBox">
<ScrollViewerx:Name="ScrollViewer" BorderBrush="{TemplateBindingBorderBrush}"BorderThickness="{TemplateBinding BorderThickness}" Background="Transparent " Foreground="{TemplateBindingForeground}"Padding="{TemplateBinding Padding}" >
<ItemsPresenter/>
</ScrollViewer>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
КомпонентListBox:
<ListBox Height="535" HorizontalAlignment="Left" x:Name="listBox1" VerticalAlignment="Top" Width="456" ItemTemplate="{StaticResourceDataTemplate1}" ItemsSource="{Binding}" ManipulationStarted="Canvas_ManipulationStarted" ManipulationCompleted="Canvas_ManipulationCompleted" Style="{StaticResourceListBoxStyle1}" />