title: XAML : How to change background color only in Design mode?
body: <p>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.</p>
  
  <p>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?</p>
  
  <p>I have tried this:</p>
  
  <pre><code>if (System.ComponentModel.DesignerProperties.IsInDesignTool)
  {
      LayoutRoot.Background = new SolidColorBrush(Colors.Blue);
  }
  </code></pre>
  
  <p>But this doesn't work. Any tips?</p>
  
  <p>UPDATE:</p>
  
  <p>I dont understand how this works for you guys. I have created a new Silverlight 4.0 Application and have inserted this line of code into the ctor:</p>
  
  <pre><code>public MainPage()
          {
              InitializeComponent();
              LayoutRoot.Background = new SolidColorBrush(Colors.Blue);
  
          }
  
  &lt;UserControl x:Class="SilverlightApplication3.MainPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      mc:Ignorable="d"
      d:DesignHeight="300" d:DesignWidth="400"&gt;
  
      &lt;Grid x:Name="LayoutRoot"&gt;
  
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>When I go into Designer, I still dont see it as blue. And I dont even have any isInDesignTime Condition there. What I am missing here?</p>
  
  <p>Thanks,
  Kave</p>