I'd like to Bind the Background of a Border Property to elements in a list.
I have a Dictionary holding the follwing:
<LinearGradientBrush x:Key="ConfigurationItemBackground" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFAABBCC" Offset="1"/>
<GradientStop Color="#FFCCDDEE" Offset="0.7"/>
</LinearGradientBrush>
<LinearGradientBrush x:Key="NavigationItemBackground" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFD97825" Offset="1"/>
<GradientStop Color="#FFFF9A2E" Offset="0.7"/>
</LinearGradientBrush>
Now I fill a ObservableCollection holding Objects that contain a Property called "BackgroundStyle". When I fill a list box with styled background I'd like to bind the Background to "BackgroundStyle"
<Border x:Name="Border" BorderThickness="1" CornerRadius="4" Width="120" Height="80"
VerticalAlignment="Center" HorizontalAlignment="Center" Padding="4"
BorderBrush="Black" Background="{Binding Path=BackgroundStyle}">
This works well, if BackgroundStyle="Red" or "Green" but it won't work if I use "ConfigurationItemBackground".
Any suggestions? Thanks for your help ;)
-Tim-