XAML : How to change background color only in Design mode?

Posted by Kave on Stack Overflow See other posts from Stack Overflow or by Kave
Published on 2011-01-30T13:54:53Z Indexed on 2011/01/30 15:25 UTC
Read the original article Hit count: 223

Filed under:
|

I have a control with white text foreground color and transparent background color. Later on this usercontrol will be added into a different control that carries the real background color.

However during designing this, control due white foreground on white background in VS 2010, I can't obviously see anything. In there anyway to define a different color for just the design time?

I have tried this:

if (System.ComponentModel.DesignerProperties.IsInDesignTool)
{
    LayoutRoot.Background = new SolidColorBrush(Colors.Blue);
}

But this doesn't work. Any tips?

Thanks, Kave

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about xaml