title: How can I define and use a variable in XAML to define a color?
body: <p>I have a number of elements in my XAML which define <strong>Foreground="#555"</strong> to be the color of faded text in a readonly textbox. </p>
  
  <pre><code>&lt;TextBlock Text="{Binding SingularModelClassFileTitle}" Margin="0 10 0 0"/&gt;
  &lt;TextBox Text="{Binding SingularModelClassFileName}"
           HorizontalAlignment="Left"
           IsReadOnly="True"
           Foreground="#555"
           Width="500"/&gt;
  &lt;TextBox 
   VerticalScrollBarVisibility="Visible"
   AcceptsReturn="True"                  
   Width="500" 
   Height="100" 
   IsReadOnly="True" 
   Foreground="#555"
   Text="{Binding SingularModelClassContent}"
   HorizontalAlignment="Left"
   Margin="0 0 0 20"/&gt;
  </code></pre>
  
  <p>How can I <strong>put this value in a XAML variable</strong> and reference in each attribute it so that I only have to change it in one place?</p>
  
  <p>I'm thinking you can do <strong>something like this</strong>:</p>
  
  <pre><code>&lt;sys:String x:Key="ReadOnlyTextColor"&gt;#555&lt;/sys:String&gt;
  
  ...
  
      &lt;TextBox Foreground="{StaticResource ReadOnlyTextColor}"/&gt;
  </code></pre>
  
  <p>And what would be the property <code>xmlns:sys=...</code> reference for this?</p>