title: Xaml designer behaves differently in VS 2012 and VS 2010
body: <p>I recently switched to Visual Studio 2012 from VS2010.
  I have some user controls which are templates for other user controls.
  The first ones have some ContentControl  whose content is defined in the second ones.</p>
  
  <p>Follows the definition of a user control based on a template control (ImpegniBaseView)</p>
  
  <pre><code>&lt;localView:ImpegniBaseView&gt;
  
          &lt;localView:ImpegniBaseView.ActionButtons&gt;
              &lt;StackPanel Height="54" HorizontalAlignment="Left"  VerticalAlignment="Top" Width="668" Orientation="Horizontal"&gt;
                  &lt;Button Content="Salva" Height="31" Width="88"  Command="{Binding Path=SaveCommand}" IsEnabled="{Binding Editable}" Margin="5,0" /&gt;
                  &lt;Button Command="{Binding Path=CreateCommand}" Content="Nuovo impegno master" Height="31" Width="Auto" 
                      Visibility="{Binding IsFirstLevelView, Converter={StaticResource BoolToVisibility}}"    
                      IsEnabled="{Binding Path=Editable, Converter={StaticResource InverseBooleanConverter}}" Margin="5,0" /&gt;
  
              &lt;/StackPanel&gt;
          &lt;/localView:ImpegniBaseView.ActionButtons&gt;
      &lt;/localView:ImpegniBaseView&gt;
  </code></pre>
  
  <p>In Vs 2010 I could easily select, for example, the button 'Salva' in the designer. Now I cannot. I suppose I have to change an option in the designer, but I don't know which one...</p>
  
  <p>Update
  Follows the relevant part of the user control used as template</p>
  
  <pre><code>&lt;UserControl x:Class="Ragioneria.View.ImpegniBaseView"
           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:local="clr-namespace:Ragioneria"
           mc:Ignorable="d" 
           d:DesignHeight="450" d:DesignWidth="700"&gt;
  
  &lt;DockPanel DataContext="{Binding ImpegnoSelezionato}"&gt;
      &lt;DockPanel DockPanel.Dock="Top"&gt;
          &lt;StackPanel Orientation="Horizontal" DockPanel.Dock="Left"&gt;
              &lt;Label Content="Anno/Num-Sub" Height="28" HorizontalAlignment="Left" Margin="5" Name="label1" VerticalAlignment="Top" Width="Auto" /&gt;
              &lt;ContentControl  Content="{Binding Path=IdentificazioneImpegnoSection, RelativeSource={RelativeSource AncestorType=UserControl}}" Width="400" Height="28" Margin="5" /&gt;
  
  
  
          &lt;/StackPanel&gt;
  
          &lt;TextBox Height="28" Width="100" Name="textBox9" Text="{Binding Path=DataRegistrazione, StringFormat=d}" DockPanel.Dock="Right" Style="{DynamicResource tb_readonly}" TextAlignment="Right" Margin="5" /&gt;
          &lt;Label Content="Data" Height="28" Margin="5" Name="label7" Width="50" DockPanel.Dock="Right"/&gt;
  
      &lt;/DockPanel&gt;
  
      &lt;ContentControl DockPanel.Dock="Bottom"  
                      DataContext="{Binding DataContext.ActiveWorkspace, RelativeSource={RelativeSource  AncestorType=Window}}"
                      Content="{Binding Path=ActionButtons, RelativeSource={RelativeSource AncestorType=UserControl}}" /&gt;
  &lt;/DockPanel&gt;
  </code></pre>
  
  <p></p>
  
  <p>Thanks
  Filippo</p>