title: Why is my Application.Resources style applied in the designer, but not at runtime?
body: <p>My question is almost the same as <a href="https://stackoverflow.com/questions/6902126">Why doesn&#39;t style-setting of the window background work?</a>.  The answer to that question is "your style targets <code>Window</code>, but that won't be applied to <code>MainWindow</code>".</p>
  
  <p>In my case, I have the following style which targets RowDefinition.  Elsewhere in my xaml, I have a standard Grid with some Row and Column definitions.  The target in <code>Application.Resources</code> exactly matches my xaml <code>RowDefinition</code> element, yet the style seems only to apply in the designer, and not at runtime.</p>
  
  <p>I'm running Visual Studio 2012, with Update 4, targeting the .NET Framework 4.5.</p>
  
  <p>App.xaml:</p>
  
  <pre><code>&lt;Application x:Class="MyProj.App"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt;
      &lt;Application.Resources&gt;
          &lt;Style TargetType="RowDefinition"&gt;
              &lt;Setter Property="Height" Value="35" /&gt;
          &lt;/Style&gt;
      &lt;/Application.Resources&gt;
  &lt;/Application&gt;
  </code></pre>
  
  <p>DriverEdit.xaml:</p>
  
  <pre><code>&lt;Window x:Class="MyProj.Windows.DriverEdit"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:p="clr-namespace:MyProj.Properties"
          xmlns:Controls="clr-namespace:MyProj.Controls"
          WindowStartupLocation="CenterOwner"
          Title="{Binding Path=SelectedItem.UniqueName, TargetNullValue='New'}" Height="300" Width="300"&gt;
      &lt;DockPanel&gt;
          &lt;StackPanel DockPanel.Dock="Right"&gt;
              &lt;Controls:CommonEditButtons /&gt;
          &lt;/StackPanel&gt;
  
          &lt;Grid&gt;
              &lt;Grid.ColumnDefinitions&gt;
                  &lt;ColumnDefinition /&gt;
                  &lt;ColumnDefinition /&gt;
              &lt;/Grid.ColumnDefinitions&gt;
              &lt;Grid.RowDefinitions&gt;
                  &lt;RowDefinition /&gt;
                  &lt;RowDefinition /&gt;
              &lt;/Grid.RowDefinitions&gt;
  
              &lt;TextBlock Grid.Column="0" Grid.Row="0" Text="{x:Static p:Resources.CommonEditID}" /&gt;
              &lt;TextBlock Grid.Column="0" Grid.Row="1" Text="{x:Static p:Resources.CommonEditName}" /&gt;
  
              &lt;TextBox Grid.Column="1" Grid.Row="0" Text="{Binding Path=SelectedItem.Id}" /&gt;
              &lt;TextBox Grid.Column="1" Grid.Row="1" Text="{Binding Path=SelectedItem.Name}" /&gt;
          &lt;/Grid&gt;
      &lt;/DockPanel&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>Edited to provide more XAML.</p>