Forum Cross Platform with Xamarin


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Access to the Application.Current.Resources on WinPhone 8.1 and Windows 8.1


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))
at Windows.UI.Xaml.Application.get_Resources()
at KC.Mobility.Technician.Win.App..ctor()
at KC.Mobility.Technician.Win.Program.<>c.

b__0_0(ApplicationInitializationCallbackParams p)

How can I set some specific brushed or colors in the default theme for the whole application?

Best Regards,

Sign In or Register to comment.