title: How to change TextBox placeholder text color for a specific element, not global
body: <p>MSDN lists the styles and templates for the <code>TextBox</code> class <a href="http://msdn.microsoft.com/en-au/library/windows/apps/xaml/jj710191.aspx">here</a>. I can override these theme resources by creating a <code>ResourceDictionary</code> in <code>App.xaml</code> like this:</p>
  
  <pre><code>&lt;Application.Resources&gt;
      &lt;ResourceDictionary&gt;
          &lt;ResourceDictionary.ThemeDictionaries&gt;
              &lt;ResourceDictionary x:Key="Default"&gt;
                  &lt;SolidColorBrush x:Key="TextBoxPlaceholderTextThemeBrush" Color="Yellow"/&gt;
              &lt;/ResourceDictionary&gt;
          &lt;/ResourceDictionary.ThemeDictionaries&gt;
      &lt;/ResourceDictionary&gt;
  &lt;/Application.Resources&gt;
  </code></pre>
  
  <p>but this will affect every <code>TextBox</code> in my app. <strong>How can I set this theme for only a specific element?</strong></p>
  
  <p>I've tried putting this dictionary in <code>Page.Resources</code> and even <code>TextBox.Resources</code> for the <code>TextBox</code> that I want to apply it to, but it doesn't work.</p>
  
  <p>I <em>really</em> don't want to have to redefine the <code>Template</code> just to change this property.</p>
  
  <hr>
  
  <p><strong>EDIT</strong> Heena's answer is close, but I would also like to set different colors for light and dark themes because my textbox has a transparent background color.</p>
  
  <p>I managed to achieve this by keeping <code>Foreground="{ThemeResource TextBoxPlaceholderTextThemeBrush}"</code> as part of the <code>Template</code> (so, in other words, the template is exactly the default as per MSDN) and then specifying in the page resources:</p>
  
  <pre><code>&lt;Page.Resources&gt;
      &lt;ResourceDictionary.ThemeDictionaries&gt;
          &lt;ResourceDictionary x:Key="Light"&gt;
              &lt;SolidColorBrush x:Key="TextBoxPlaceholderTextThemeBrush" Color="Blue"/&gt;
          &lt;/ResourceDictionary&gt;
          ...
      &lt;/ResourceDictionary.ThemeDictionaries&gt;
  &lt;/Page.Resources&gt;
  </code></pre>
  
  <p><em>but</em> this now means I have to put a huge <code>ControlTemplate</code> style-setter for the textbox in my page resources too, which is just an exact duplicate of the default anyway!</p>
  
  <p>Does this have something to do with how <code>TextBoxPlaceholderTextThemeBrush</code> is resolved from within the <code>ControlTemplate</code>? i.e. the reason why it discovers my custom theme dictionary is because the <code>ControlTemplate</code> was defined in the same resource dictionary?</p>
  
  <p>How is this supposed to be done? Should I just subclass the textbox so that all that XAML can be moved to another file (even if it is just for one textbox)?</p>