Phone Resources
All of the known phone resources have accessors to give you strongly-typed access to the phone-based resources. Static Classes include:
- PhoneColors
- PhoneBrushes
- PhoneFontSizes
- PhoneFontFamilies
- PhoneTextStyles
- PhoneThicknesses
var theContainer = new Border()
{
Background = PhoneBrushes.PhoneContrastBackgroundBrush,
BorderBrush = PhoneBrushes.PhoneBorderBrush,
BorderThickness = PhoneThicknesses.PhoneBorderThickness,
CornerRadius = new CornerRadius(5)
};
theContainer.Child = new TextBlock()
{
Margin = PhoneThicknesses.PhoneMargin,
TextWrapping = TextWrapping.Wrap,
Style = PhoneTextStyles.PhoneTextNormalStyle,
Foreground = PhoneBrushes.PhoneAccentBrush,
Text = message
};
In addition a PhoneTheme class that gives you a simple way to test for which theme (light or dark) the phone is using:
if (PhoneTheme.IsDarkTheme)
{
// Change something because it's dark
}
else
{
// Change it because it's light
}