title: WPF "not a valid value for property" error for attached property even though it works as expected
body: <p>I have a TextBox with an attached property on it, and Visual Studio gives me an error saying that the property value is not valid, even though it is in fact valid.</p>
  
  <p>Here's the TextBox:</p>
  
  <pre><code>&lt;TextBox 
      HorizontalAlignment="Stretch" 
      VerticalAlignment="Top" 
      Width="Auto" 
      styleExtensions:TextBoxExtension.BorderStyle="None"/&gt;
  </code></pre>
  
  <p>And this is the AttachedProperty:</p>
  
  <pre><code>public enum BorderStyle
  {
      Rounded,
      BottomOnly,
      None
  }
  
  public static DependencyProperty BorderStyleProperty =
          DependencyProperty.RegisterAttached(
              "BorderStyle",
              typeof(BorderStyle),
              typeof(TextBoxExtension));
  </code></pre>
  
  <p>The <code>GetBorderStyle</code> and <code>SetBorderStyle</code> methods are also present, and since they do nothing special, I didn't paste them here.</p>
  
  <p>When I rut it, the program works as expected, all three values for <code>BorderStyle</code> do what they're supposed to (they trigger different changes in a <code>Style</code>) and even the visual xaml editor shows the changes as expected, but for some reason Visual Studio keeps giving me this pointless error for this particular TextBox:</p>
  
  <pre><code>'None' is not a valid value for property 'BorderStyle'
  </code></pre>
  
  <p>The error persists for all three values of the enum. The same attached property is also used somewhere else in a ControlTemplate, on a different TextBox and it doesn't trigger this error.</p>
  
  <p>I've tried cleaning the solution, rebuilding it, deleting the bin and obj folders, deleting the .vs folder, but the error keeps showing up.</p>
  
  <p>Am I doing something wrong here, or is Visual Studio wrong? And if so, is there a workaround to disable this specific error message?</p>
  
  <p>I'm using Visual Studio 2017 15.8.8, and .NET Framework 4.7.03056</p>
  
  <p><strong>EDIT:</strong> The same behavior can be observed in the new 2019 preview of VS. Am I going crazy?</p>