ListViewItem'in Arkaplanını satır için öğeye bağlamak için bir Stil kullanmak isteyeceksiniz. Ürünü Listviewıtem varsayılan DataContext yüzden bu basit olmalıdır geçerli:
yerine bütün bir parçayı size backgroundColor bağlamak ederiz ancak yukarıdaki benzer olmalıdır bağlanabilen
<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid.Resources>
<x:Array x:Key="colors" Type="{x:Type sys:String}">
<sys:String>Red</sys:String>
<sys:String>Yellow</sys:String>
<sys:String>#0000FF</sys:String>
</x:Array>
</Grid.Resources>
<ListView ItemsSource="{StaticResource colors}">
<ListView.Resources>
<Style TargetType="{x:Type ListViewItem}">
<Setter Property="Background" Value="{Binding .}"/>
</Style>
</ListView.Resources>
</ListView>
</Grid>
. Bir "#" önekine bağlanan bir dönüştürücü kullanmanız gerekiyor, bu da dahili BrushConverter'ın hex olarak ayrıştırmak için verdiği sinyal.