title: A loop was detected in the property expressions
body: <p>I'm working on a VS 2012 Express WPF project (C# code-behind) and I'm getting the error "A loop was detected in the property expressions".  Now before I continue, I know why I'm getting it - I'm just not sure what to do about it or if it even needs to be handled because even though it shows up in the error list and is underlined in blue, the program compiles and runs just fine.  I've Googled this of course and results have varied.  My question is a two-parter but first, here's the rundown:</p>
  
  <p>The offending code:</p>
  
  <pre><code>&lt;Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}"&gt;
  &lt;!-- setter properties --&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>As you can see, it's a style for Button that refers to Button which is what causes the issue.  The first workaround I read involved separating the code like so:</p>
  
  <pre><code>&lt;Style x:Key="ButtonStyleToApply" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}"&gt;
      &lt;!-- setter properties --&gt;
  &lt;/Style&gt;
  &lt;!-- and in another style dictionary, --&gt;
  &lt;Style TargetType="{x:Type Button}" BasedOn="{StaticResource ButtonStyleToApply}"/&gt;
  </code></pre>
  
  <p>...and then the two style sets go into different dictionaries.  Obviously, this didn't do any good either - VS still sniffed out what I was doing but it still compiles and runs fine.  Now here is yet another workaround:</p>
  
  <p>"There were some architectural changes in the XAML Designer in Visual Studio which has regressed this scenario. We will work to improve this experience in future but right now you can work-around this issue by not defining the resources in the Application object (App.xaml) but instead defining them in the local document (MainPage.xaml)"</p>
  
  <p>This was posted in a tech support query <a href="http://connect.microsoft.com/VisualStudio/feedback/details/773795/vs2012-implicit-style-based-on-implicit-style-error-a-loop-was-detected-in-the-property-expressions" rel="noreferrer">Here</a>. (Connect.Microsoft.Com)</p>
  
  <p>But I trust hands on experience from the every-man.  What can my fellow coders tell me?  My question is a two-parter.  1. Do I even need to bother with the workaround if the program is compiling? And 2. If I'm good to go, is there a way to tell VS to just ignore it?  I know ignoring it on my part or VS's is probably considered "bad practice" but beyond that...?</p>