<Window
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:local="clr-namespace:_44630_Applying_Colors_Through_Binding"
	x:Class="_44630_Applying_Colors_Through_Binding.MainWindow"
	x:Name="Window"
	Title="MainWindow"
	Width="640" Height="480" mc:Ignorable="d">

	<Window.Resources>
		<local:StringToBrushConverter x:Key="myConverter" />
		<Style TargetType="telerik:GridViewRow">
			<Setter Property="Background" Value="{Binding Property5, Converter={StaticResource myConverter}}" />
		</Style>
		<ControlTemplate x:Key="GridViewRowControlTemplate1" TargetType="{x:Type telerik:GridViewRow}">
			<Grid x:Name="grid">
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto"/>
					<ColumnDefinition Width="Auto"/>
					<ColumnDefinition Width="Auto"/>
				</Grid.ColumnDefinitions>
				<Grid.RowDefinitions>
					<RowDefinition Height="*"/>
					<RowDefinition Height="Auto"/>
				</Grid.RowDefinitions>
				<Border x:Name="SelectionBackground" Margin="{TemplateBinding Margin}" MinHeight="{TemplateBinding MinHeight}" SnapsToDevicePixels="True" Grid.Column="2" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}"/>
				<Rectangle x:Name="BackgroundRectangle" Opacity="0" Grid.Column="2">
					<Rectangle.Fill>
						<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
							<GradientStop Color="#FFFFCA5D" Offset="1"/>
							<GradientStop Color="#FFFFDC9C" Offset="0"/>
						</LinearGradientBrush>
					</Rectangle.Fill>
				</Rectangle>
				<telerik:IndicatorPresenter x:Name="PART_IndicatorPresenter" Background="#FFDBDEE1" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,0,1,1" IsTabStop="False" Visibility="{TemplateBinding RowIndicatorVisibility}" Grid.Column="0" Grid.Row="0" Grid.RowSpan="2">
					<telerik:StyleManager.Theme>
						<telerik:Office_BlackTheme/>
					</telerik:StyleManager.Theme>
					<Path x:Name="NavigatorIndicator" Stretch="Fill" HorizontalAlignment="Center" VerticalAlignment="Center" Width="5" Height="8" Visibility="Collapsed" Data="M254.5,183.75L254.5,193.33333 260.75,188.16682z">
						<Path.Fill>
							<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
								<GradientStop Color="Black" Offset="0"/>
								<GradientStop Color="Black" Offset="1"/>
							</LinearGradientBrush>
						</Path.Fill>
					</Path>
				</telerik:IndicatorPresenter>
				<telerik:IndentPresenter x:Name="PART_IndentPresenter" Background="{TemplateBinding Background}" IsTabStop="False" Grid.Column="1" IndentLevel="{TemplateBinding IndentLevel}">
					<telerik:StyleManager.Theme>
						<telerik:Office_BlackTheme/>
					</telerik:StyleManager.Theme>
				</telerik:IndentPresenter>
				<telerik:DataCellsPresenter x:Name="PART_DataCellsPresenter" MinHeight="{TemplateBinding MinHeight}" Height="Auto" IsTabStop="False" Grid.Column="2" RadRowItem="{x:Null}">
					<telerik:StyleManager.Theme>
						<telerik:Office_BlackTheme/>
					</telerik:StyleManager.Theme>
				</telerik:DataCellsPresenter>
				<telerik:HorizontalScrollPanel x:Name="PART_DetailsScrollContainer" HorizontalAlignment="Stretch" Grid.Column="2" Grid.Row="1" ScrollOffset="0">
					<telerik:DetailsPresenter x:Name="PART_DetailsPresenter" IsTabStop="False" Visibility="Collapsed" DetailsProvider="{TemplateBinding DetailsProvider}">
						<telerik:StyleManager.Theme>
							<telerik:Office_BlackTheme/>
						</telerik:StyleManager.Theme>
					</telerik:DetailsPresenter>
				</telerik:HorizontalScrollPanel>
				<Rectangle x:Name="InvalidBorder" Stroke="Red" StrokeThickness="2" Margin="0" Width="Auto" Height="Auto" Visibility="Collapsed" Grid.Column="0" Grid.ColumnSpan="3"/>
			</Grid>
			<ControlTemplate.Triggers>
				<Trigger Property="IsSelected" Value="True">
					<Setter Property="Opacity" TargetName="BackgroundRectangle" Value="1"/>
				</Trigger>
				<MultiTrigger>
					<MultiTrigger.Conditions>
						<Condition Property="IsSelected" Value="False"/>
						<Condition Property="IsMouseOver" Value="True"/>
					</MultiTrigger.Conditions>
					<Setter Property="Opacity" TargetName="BackgroundRectangle" Value="0.5"/>
				</MultiTrigger>
				<MultiTrigger>
					<MultiTrigger.Conditions>
						<Condition Property="IsSelected" Value="True"/>
						<Condition Property="IsCurrent" Value="False"/>
					</MultiTrigger.Conditions>
					<Setter Property="Opacity" TargetName="BackgroundRectangle" Value="1"/>
				</MultiTrigger>
				<Trigger Property="IsContentValid" Value="False">
					<Setter Property="Visibility" TargetName="InvalidBorder" Value="Visible"/>
				</Trigger>
				<Trigger Property="IsCurrent" Value="True">
					<Setter Property="Visibility" TargetName="NavigatorIndicator" Value="Visible"/>
				</Trigger>
			</ControlTemplate.Triggers>
		</ControlTemplate>
	</Window.Resources>
	
	<Grid x:Name="LayoutRoot">
		<telerik:RadGridView x:Name="gridView" ItemsSource="{Binding Collection, Source={StaticResource SampleDataSource}}"/>
		<telerik:GridViewRow Margin="0,0,249,-85" VerticalAlignment="Bottom" Height="50" Content="GridViewRow" Template="{DynamicResource GridViewRowControlTemplate1}"/>
	</Grid>
</Window>