title: App.xaml style cannot be used in Usercontrol, how come?
body: <p>I have a style for a textblock that is set inside my app.xaml this is then applied to textblocked through out my application and works fine.</p>
  
  <p>However i get an error: "could not create instance of type" if i apply this style to a textblock within my user control, how come this is a problem?</p>
  
  <pre><code>&lt;UserControl x:Class="Client.Usercontrols.MyButton"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" MinHeight="30" MinWidth="40"
  DataContext="{Binding RelativeSource={RelativeSource Self}}"&gt;
  
  &lt;Button Width="Auto" HorizontalAlignment="Center"&gt;
  
      &lt;Border CornerRadius="5" BorderThickness="1" BorderBrush="Transparent" &gt;
          &lt;Grid&gt;
              &lt;Image Name="tehImage" Source="{Binding ImageSource}" /&gt;
              &lt;TextBlock Name="tehText" Text="{Binding Text}" 
                  Style="{StaticResource ButtonText}" /&gt; &lt;-- This causes error
          &lt;/Grid&gt;
      &lt;/Border&gt;
  
  &lt;/Button&gt;
  </code></pre>
  
  <p></p>
  
  <p>Thanks,
  Kohan</p>
  
  <p>-- App.Xaml Code --</p>
  
  <pre><code>&lt;Application x:Class="Client.App"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      StartupUri="Mainpage.xaml"&gt;
      &lt;Application.Resources&gt;
          &lt;ResourceDictionary&gt;
              &lt;ResourceDictionary.MergedDictionaries&gt;
                  &lt;ResourceDictionary Source="Styles/CascadingStyles.xaml" /&gt;
              &lt;/ResourceDictionary.MergedDictionaries&gt;
          &lt;/ResourceDictionary&gt;
      &lt;/Application.Resources&gt;
  &lt;/Application&gt;
  </code></pre>
  
  <p>-- CascadingStyles.Xaml --</p>
  
  <pre><code> &lt;Style TargetType="{x:Type TextBlock}" x:Key="ButtonText" &gt;
      &lt;Setter Property="FontSize" Value="10" /&gt;
      &lt;Setter Property="VerticalAlignment" Value="Bottom" /&gt;
      &lt;Setter Property="HorizontalAlignment" Value="Center" /&gt;
      &lt;Setter Property="FontFamily" Value="Lucida Sans Unicode" /&gt;
      &lt;Setter Property="Foreground" Value="#0F004E" /&gt;
   &lt;/Style&gt;
  </code></pre>