Boolean isDark = false;

var bgtheme = Application.Current.Resources[“PhoneBackgroundColor”].ToString();
if (bgtheme == “#FF000000”)
isDark = true;
else
isDark = false;

if (isDark)
{
TextContent.Foreground = new SolidColorBrush(Colors.White);
ContentPanel.Background = “your dark theme background”;

}
else
{
TextContent.Foreground = new SolidColorBrush(Colors.Black);
ContentPanel.Background = “your light theme background”;
}

Leave a Reply