I have created a template for multiple listboxitems and some textblocks inside. In the settings the user can change the background of the app to black or white (and then the textblock foreground color should change the opposite accordingly). How can I bind the textblocks text to one property (of the itemlist (observablecollection)) and the foreground to another property (with a converter for the color) which is not in the same datacontext (but in the settings-datacontext)?
What I am trying to do:
<DataTemplate x:Key="ArticleItemTemplateClassic">
<Grid>
<!-- ... --->
<TextBlock Text="{Binding Description}"
Foreground="{Binding SettingsFile.BlackBackgroundEnabled,
Converter={StaticResource InverseBackgroundColorConverter}}"/>
<!-- The Context of the Foreground (SettingsFile.BlackBackgroundEnabled) -->
<!-- should be not the same as where I bind Description -->
</StackPanel>
<!-- ... --->
</Grid>
</DataTemplate>
Thank you!