My application has some areas which get colorized by the color codes I get from a web application. I thought a lot about how to achieve this and I don't know how to approach this problem.
My first thought was to write a ValueConverter which just provides those colors so that I can debug whenever it did work.
But now that I'm trying to use it on some styles I ran into the problem that I can't use ValueConverter in App.xaml.
So what I'm trying to archive is that when I navigate to something like the mainpage.xaml where no user specific content is shown I want to use the my company's colors but when the user navigates to pages where the content is user specific I want to display the company colors of the current user.
So I searched on stackoverflow how to accomplish this and I come across this post here. But I always get an binding failed message in the output window.
<Setter Property="Background"> <Setter.Value> <Binding Path="Background" RelativeSource="{RelativeSource Self}" TargetNullValue="a" FallbackValue="a"> <Binding.Converter> <provider:DarkBackgroundProvider/> </Binding.Converter> </Binding> </Setter.Value> </Setter> Any ideas or maybe an other approach on this?
I also read on some sites that I can replace values from App.xaml, but it did not work for me cause I got exceptions whenever I wanted to set the value of the App.Resources[] = Color