I want to change some colors in WinPhone 8.1 and Windows 8.1 applications. For example, I want to change Accent color, or Selection color, or Entry text color. As I know it is possible to set color or brush via Application.Current.Resources dictionary:
(Application.Current.Resources["BackgroundBrush"] as SolidColorBrush).Color = Colors.Orange;
as it mentioned in the following articles:
But when I try to access to the Application.Current.Resources in my App.xaml.cs class constructor I get an exception:
System.Exception was unhandled by user code
Message=Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
How can I set some specific brushed or colors in the default theme for the whole application?