<Window 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"		
        Title="Chapitre 5 - DataGrid - XML - Couleurs" 
        Width="520" 
        Height="300"  
		BorderBrush="DodgerBlue"
		>

    <Grid>		
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">

<DataGrid
	Name="Datagrid_Machines"
	Width="Auto"
	Height="Auto"
	Margin="2,2,2,2"
	ColumnWidth="150"
	ItemsSource="{Binding}"
	SelectionMode="Extended">
				  
	<DataGrid.Resources>
		<Style BasedOn="{StaticResource {x:Type DataGridColumnHeader}}" TargetType="{x:Type DataGridColumnHeader}">
			<Setter Property="Background" Value="Gray" />
			<Setter Property="FontSize" Value="14" />
			<Setter Property="Foreground" Value="White" />
			<Setter Property="BorderBrush" Value="Red" />
		</Style>
	</DataGrid.Resources>					  
				  
				  
	<DataGrid.RowStyle>
		<Style TargetType="DataGridRow"> 
			<Setter Property="IsHitTestVisible" Value="False"/>						
			<Style.Triggers>
				<DataTrigger Binding="{Binding Status}" Value="En cours">
					<Setter Property="Background" Value="#5290E9"></Setter>
				</DataTrigger>			
				<DataTrigger Binding="{Binding Status}" Value="Echec">
					<Setter Property="Background" Value="#E14D57"></Setter>
				</DataTrigger>			
				<DataTrigger Binding="{Binding Status}" Value="Succes">
					<Setter Property="Background" Value="#71B37C"></Setter>
				</DataTrigger>
			</Style.Triggers>
		</Style>
	</DataGrid.RowStyle>					  

	<DataGrid.Columns>
		<DataGridTextColumn Binding="{Binding Nom}" Header="Nom"/>
		<DataGridTextColumn Binding="{Binding Status}" Header="Status"/>
		<DataGridTextColumn Binding="{Binding Ville}" Header="Ville"/>
	</DataGrid.Columns>
</DataGrid>

</StackPanel>
           

    </Grid>
</Window>        