title: Undeclared namespace
body: <p>I've been trying so hard to find an external package to make my WPF Apps in VS 2010 Express Edition look like Metro UI but this version does not support it, so I found this thread: <a href="https://stackoverflow.com/questions/13592326/making-wpf-applications-look-metro-styled-even-in-windows-7-window-chrome-t">Making WPF applications look Metro-styled, even in Windows 7? (Window Chrome / Theming / Theme)</a> in which the user creates an own Theme. I have tried to adapt his code to my App (namespace WpfApplication1 and window MainWindow, as it is set by default) but I get an error at this part:</p>
  
  <pre><code>&lt;Style x:Key="MainWindowStyle" TargetType="WpfApplication1:MainWindow"&gt;
  </code></pre>
  
  <p>Where it says that WpfApplication1 is an undeclared namespace.
  I don't know why this happens since the namespace has the following shape:</p>
  
  <pre><code>namespace WpfApplication1
  {
      /// &lt;summary&gt;
      /// Interaction logic for MainWindow.xaml
      /// &lt;/summary&gt;
      public partial class MainWindow : Window
      {
          public MainWindow()
          {
              InitializeComponent();
          }
      }
  }
  </code></pre>
  
  <p>And this is the whole code from this other guy adapted to my workspace:</p>
  
  <pre><code>&lt;Window x:Class="WpfApplication1.MainWindow"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      Title="MainWindow" Height="150" Width="350"&gt;
  &lt;Window.Resources&gt;
      &lt;BooleanToVisibilityConverter x:Key="bool2VisibilityConverter" /&gt;
  
      &lt;Color x:Key="WindowBackgroundColor"&gt;#FF2D2D30&lt;/Color&gt;
      &lt;Color x:Key="HighlightColor"&gt;#FF3F3F41&lt;/Color&gt;
      &lt;Color x:Key="BlueColor"&gt;#FF007ACC&lt;/Color&gt;
      &lt;Color x:Key="ForegroundColor"&gt;#FFF4F4F5&lt;/Color&gt;
  
      &lt;SolidColorBrush x:Key="WindowBackgroundColorBrush" Color="{StaticResource WindowBackgroundColor}"/&gt;
      &lt;SolidColorBrush x:Key="HighlightColorBrush" Color="{StaticResource HighlightColor}"/&gt;
      &lt;SolidColorBrush x:Key="BlueColorBrush" Color="{StaticResource BlueColor}"/&gt;
      &lt;SolidColorBrush x:Key="ForegroundColorBrush" Color="{StaticResource ForegroundColor}"/&gt;
  
      &lt;Style x:Key="WindowButtonStyle" TargetType="{x:Type Button}"&gt;
          &lt;Setter Property="Foreground" Value="{DynamicResource ForegroundColorBrush}" /&gt;
          &lt;Setter Property="Background" Value="Transparent" /&gt;
          &lt;Setter Property="HorizontalContentAlignment" Value="Center" /&gt;
          &lt;Setter Property="VerticalContentAlignment" Value="Center" /&gt;
          &lt;Setter Property="Padding" Value="1" /&gt;
          &lt;Setter Property="Template"&gt;
              &lt;Setter.Value&gt;
                  &lt;ControlTemplate TargetType="{x:Type Button}"&gt;
                      &lt;Grid Background="{TemplateBinding Background}"&gt;
                          &lt;ContentPresenter x:Name="contentPresenter"
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                        SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                        Margin="{TemplateBinding Padding}"
                        RecognizesAccessKey="True" /&gt;
                      &lt;/Grid&gt;
                      &lt;ControlTemplate.Triggers&gt;
                          &lt;Trigger Property="IsMouseOver" Value="True"&gt;
                              &lt;Setter Property="Background" Value="{StaticResource HighlightColorBrush}" /&gt;
                          &lt;/Trigger&gt;
                          &lt;Trigger Property="IsPressed" Value="True"&gt;
                              &lt;Setter Property="Background" Value="{DynamicResource BlueColorBrush}" /&gt;
                          &lt;/Trigger&gt;
                          &lt;Trigger Property="IsEnabled" Value="false"&gt;
                              &lt;Setter TargetName="contentPresenter" Property="Opacity" Value=".5" /&gt;
                          &lt;/Trigger&gt;
                      &lt;/ControlTemplate.Triggers&gt;
                  &lt;/ControlTemplate&gt;
              &lt;/Setter.Value&gt;
          &lt;/Setter&gt;
      &lt;/Style&gt;
  
      &lt;Style x:Key="MainWindowStyle" TargetType="WpfApplication1:MainWindow"&gt;
          &lt;Setter Property="Foreground" Value="{DynamicResource ForegroundColorBrush}" /&gt;
          &lt;Setter Property="Background" Value="{DynamicResource WindowBackgroundBrush}"/&gt;
          &lt;Setter Property="ResizeMode" Value="CanResizeWithGrip" /&gt;
          &lt;Setter Property="UseLayoutRounding" Value="True" /&gt;
          &lt;Setter Property="TextOptions.TextFormattingMode" Value="Display" /&gt;
          &lt;Setter Property="Template"&gt;
              &lt;Setter.Value&gt;
                  &lt;ControlTemplate TargetType="WpfApplication1:MainWindow"&gt;
                      &lt;Border x:Name="WindowBorder" Margin="{Binding Source={x:Static SystemParameters.WindowNonClientFrameThickness}}" Background="{StaticResource WindowBackgroundColorBrush}"&gt;
                          &lt;Grid&gt;
                              &lt;Border BorderThickness="1"&gt;
                                  &lt;AdornerDecorator&gt;
                                      &lt;Grid x:Name="LayoutRoot"&gt;
                                          &lt;Grid.RowDefinitions&gt;
                                              &lt;RowDefinition Height="25" /&gt;
                                              &lt;RowDefinition Height="*" /&gt;
                                              &lt;RowDefinition Height="15" /&gt;
                                          &lt;/Grid.RowDefinitions&gt;
                                          &lt;ContentPresenter Grid.Row="1" Grid.RowSpan="2" Margin="7"/&gt;
                                          &lt;Rectangle x:Name="HeaderBackground" Height="25" Fill="{DynamicResource WindowBackgroundColorBrush}" VerticalAlignment="Top" Grid.Row="0"/&gt;
                                          &lt;StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Grid.Row="0"&gt;
                                              &lt;Button Command="{Binding Source={x:Static SystemCommands.MinimizeWindowCommand}}" ToolTip="minimize" Style="{StaticResource WindowButtonStyle}"&gt;
                                                  &lt;Button.Content&gt;
                                                      &lt;Grid Width="30" Height="25" RenderTransform="1,0,0,1,0,1"&gt;
                                                          &lt;Path Data="M0,6 L8,6 Z" Width="8" Height="7" VerticalAlignment="Center" HorizontalAlignment="Center"
                                                      Stroke="{Binding Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Button}}" StrokeThickness="2"  /&gt;
                                                      &lt;/Grid&gt;
                                                  &lt;/Button.Content&gt;
                                              &lt;/Button&gt;
                                              &lt;Grid Margin="1,0,1,0"&gt;
                                                  &lt;Button x:Name="Restore" Command="{Binding Source={x:Static SystemCommands.RestoreWindowCommand}}" ToolTip="restore" Visibility="Collapsed" Style="{StaticResource WindowButtonStyle}"&gt;
                                                      &lt;Button.Content&gt;
                                                          &lt;Grid Width="30" Height="25" UseLayoutRounding="True" RenderTransform="1,0,0,1,.5,.5"&gt;
                                                              &lt;Path Data="M2,0 L8,0 L8,6 M0,3 L6,3 M0,2 L6,2 L6,8 L0,8 Z" Width="8" Height="8" VerticalAlignment="Center" HorizontalAlignment="Center"
                                                          Stroke="{Binding Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Button}}" StrokeThickness="1"  /&gt;
                                                          &lt;/Grid&gt;
                                                      &lt;/Button.Content&gt;
                                                  &lt;/Button&gt;
                                                  &lt;Button x:Name="Maximize" Command="{Binding Source={x:Static SystemCommands.MaximizeWindowCommand}}" ToolTip="maximize" Style="{StaticResource WindowButtonStyle}"&gt;
                                                      &lt;Button.Content&gt;
                                                          &lt;Grid Width="31" Height="25"&gt;
                                                              &lt;Path Data="M0,1 L9,1 L9,8 L0,8 Z" Width="9" Height="8" VerticalAlignment="Center" HorizontalAlignment="Center"
                                                          Stroke="{Binding Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Button}}" StrokeThickness="2"  /&gt;
                                                          &lt;/Grid&gt;
                                                      &lt;/Button.Content&gt;
                                                  &lt;/Button&gt;
                                              &lt;/Grid&gt;
                                              &lt;Button Command="{Binding Source={x:Static SystemCommands.CloseWindowCommand}}" ToolTip="close"  Style="{StaticResource WindowButtonStyle}"&gt;
                                                  &lt;Button.Content&gt;
                                                      &lt;Grid Width="30" Height="25" RenderTransform="1,0,0,1,0,1"&gt;
                                                          &lt;Path Data="M0,0 L8,7 M8,0 L0,7 Z" Width="8" Height="7" VerticalAlignment="Center" HorizontalAlignment="Center"
                                                      Stroke="{Binding Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Button}}" StrokeThickness="1.5"  /&gt;
                                                      &lt;/Grid&gt;
                                                  &lt;/Button.Content&gt;
                                              &lt;/Button&gt;
                                          &lt;/StackPanel&gt;
                                          &lt;TextBlock x:Name="WindowTitleTextBlock" Grid.Row="0" Text="{TemplateBinding Title}" HorizontalAlignment="Left" TextTrimming="CharacterEllipsis" VerticalAlignment="Center"  Margin="8 -1 0 0"  FontSize="16"  Foreground="{TemplateBinding Foreground}"/&gt;
                                          &lt;Grid Grid.Row="2"&gt;
                                              &lt;Path x:Name="ResizeGrip" Visibility="Collapsed" Width="12" Height="12" Margin="1" HorizontalAlignment="Right"
                                      Stroke="{StaticResource BlueColorBrush}" StrokeThickness="1" Stretch="None" Data="F1 M1,10 L3,10 M5,10 L7,10 M9,10 L11,10 M2,9 L2,11 M6,9 L6,11 M10,9 L10,11 M5,6 L7,6 M9,6 L11,6 M6,5 L6,7 M10,5 L10,7 M9,2 L11,2 M10,1 L10,3" /&gt;
                                          &lt;/Grid&gt;
                                      &lt;/Grid&gt;
                                  &lt;/AdornerDecorator&gt;
                              &lt;/Border&gt;
                              &lt;Border BorderBrush="{StaticResource BlueColorBrush}" BorderThickness="1" Visibility="{Binding IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Converter={StaticResource bool2VisibilityConverter}}" /&gt;
                          &lt;/Grid&gt;
                      &lt;/Border&gt;
                      &lt;ControlTemplate.Triggers&gt;
                          &lt;Trigger Property="WindowState" Value="Maximized"&gt;
                              &lt;Setter TargetName="Maximize" Property="Visibility" Value="Collapsed" /&gt;
                              &lt;Setter TargetName="Restore" Property="Visibility" Value="Visible" /&gt;
                              &lt;Setter TargetName="LayoutRoot" Property="Margin" Value="7" /&gt;
                          &lt;/Trigger&gt;
                          &lt;Trigger Property="WindowState" Value="Normal"&gt;
                              &lt;Setter TargetName="Maximize" Property="Visibility" Value="Visible" /&gt;
                              &lt;Setter TargetName="Restore" Property="Visibility" Value="Collapsed" /&gt;
                          &lt;/Trigger&gt;
                          &lt;MultiTrigger&gt;
                              &lt;MultiTrigger.Conditions&gt;
                                  &lt;Condition Property="ResizeMode" Value="CanResizeWithGrip" /&gt;
                                  &lt;Condition Property="WindowState" Value="Normal" /&gt;
                              &lt;/MultiTrigger.Conditions&gt;
                              &lt;Setter TargetName="ResizeGrip" Property="Visibility" Value="Visible" /&gt;
                          &lt;/MultiTrigger&gt;
                      &lt;/ControlTemplate.Triggers&gt;
                  &lt;/ControlTemplate&gt;
              &lt;/Setter.Value&gt;
          &lt;/Setter&gt;
  
      &lt;/Style&gt;
  &lt;/Window.Resources&gt;
  </code></pre>
  
  <p></p>
  
  <p>Any ideas where it might be failing? Thanks!</p>