title: Usercontrol style trigger not working
body: <p>I am pretty sure this question has been asked from time to time since I found another question with about the same contents, <a href="https://stackoverflow.com/questions/7796297/wpf-usercontrols-triggers-and-changing-other-controls">here</a>. But when I try to figure using all those pages, I'm just stuck...
  This is what I'm trying to do. I created a usercontrol to select a file and show the path to the file in a textbox. Just like in HTML (input type=file). That all works great and as expected. But when I try to change the colour of the textbox using a trigger (FilePathIsValid), it just does not work. The dependency properties all work fine, as said above. But the style just is not assigned to the textbox.
  Here is my XAML - can anybody tell me what I'm doing wrong? (Code Behind <a href="http://pastebin.com/GjW1MtNS" rel="nofollow noreferrer">here</a>, if needed)</p>
  
  <pre><code>&lt;UserControl x:Class="Project.Controls.SelectFileBox"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:Controls="clr-namespace:Project.Controls"
           x:Name="ThisUserControl"
           mc:Ignorable="d" d:DesignHeight="30" d:DesignWidth="300"&gt;
  &lt;UserControl.Resources&gt;
      &lt;!-- This does not work... --&gt;
      &lt;Style TargetType="{x:Type Controls:SelectFileBox}"&gt;
          &lt;Style.Triggers&gt;
              &lt;Trigger Property="FilePathIsValid" Value="false"&gt;
                  &lt;Setter Property="TextBoxBorderColor" Value="red"/&gt;
              &lt;/Trigger&gt;
          &lt;/Style.Triggers&gt;
      &lt;/Style&gt;
      &lt;!-- Neither does this: FilePathIsValid can't be found --&gt;
      &lt;Style TargetType="{x:Type TextBox}"&gt;
          &lt;Style.Triggers&gt;
              &lt;Trigger Property="FilePathIsValid" Value="false"&gt;
                  &lt;Setter Property="BorderBrush" Value="red"/&gt;
              &lt;/Trigger&gt;
          &lt;/Style.Triggers&gt;
      &lt;/Style&gt;
  &lt;/UserControl.Resources&gt;
  &lt;Grid&gt;
      &lt;Grid.ColumnDefinitions&gt;
          &lt;ColumnDefinition Width="*"/&gt;
          &lt;ColumnDefinition Width="100"/&gt;
      &lt;/Grid.ColumnDefinitions&gt;
      &lt;TextBox Grid.Column="0" Margin="3" IsEnabled="{Binding ElementName=ThisUserControl,Path=TextBoxIsEnabled}" Text="{Binding ElementName=ThisUserControl,Path=FilePath}" BorderThickness="{Binding ElementName=ThisUserControl, Path=TextBoxBorderThickness}"/&gt;
      &lt;Button Grid.Column="1" Margin="0,3,3,3" Content="{Binding ElementName=ThisUserControl, Path=ButtonText}" Click="SelectFileClick"/&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>