Hello I have been looking for over 2 hours and couldn't find a proper solution. I need help how to Bind a Value from the App.config in XAML (not in C#).
This is a Grid with a Background, it had a Path but I want to Bind it to the App.config
<Grid x:Name="MainGrid">
<Grid.Background>
<ImageBrush ImageSource="{Binding Source=}" Stretch="UniformToFill"/>
</Grid.Background>
and here is my App.config, as I don't know which one is correct (in my wpf Book applicationSettings is used) I post both:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="bg_sun_key" value="../Assets/sun.png"/>
</appSettings>
<applicationSettings>
<MyAppName.Properties.Settings>
<setting name="bg_sun" serializeAs="String">
<value>../Assets/sun.png</value>
</setting>
<setting name="bg_planet" serializeAs="String">
<value>../Assets/planet.png</value>
</setting>
</MyAppName.Properties.Settings>
</applicationSettings>
</configuration>
What I have to write in {Binding ...}? Any other suggestions?
I'm new to C# and UWP so please consider that for your answer. Thanks for the help.