Accessing the apps AccentColor in C#...

Dec 18, 2013 at 6:38 PM
This has to be a simple question to answer, but I have been struggling with it all morning.

I have created a Modern UI WPF Application and I would like to dynamically set the background property of a textbox to the Appearance color selected on the settings page of the MUI app through c#. Is there an easy way to do this?

On a related note... is there a way to save the color choice, theme, and font size within the app so that the theme states stick on re-launch? It currently rolls back to the default when the app is closed and reopened.

Thank you in advance.
Dec 19, 2013 at 8:58 PM
Never mind... I have a solution.

I used the SolidColorBrush to access the color with the following code.
Brush brush = new SolidColorBrush((Color)this.FindResource("AccentColor"));
Still haven't found a good solution to keeping the state of the settings around.
Marked as answer by couth on 12/19/2013 at 12:58 PM