string color="Red"string s = " xmlns='http://schemas.microsoft.com/client/2007'";s+=" xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'" ;s+=" Color='"+color+"'/>";SolidColorBrush brush =(SolidColorBrush) XamlReader.Load(s);LayoutRoot.Background = brush;