title: WPF TextBox MaxLength -- Is there any way to bind this to the Data Validation Max Length on the bound field?
body: <p>ViewModel:</p>
  
  <pre><code>public class MyViewModel
  {
      [Required, StringLength(50)]
      public String SomeProperty { ... }
  }
  </code></pre>
  
  <p>XAML:</p>
  
  <pre><code>&lt;TextBox Text="{Binding SomeProperty}" MaxLength="50" /&gt;
  </code></pre>
  
  <p>Is there any way to avoid setting the MaxLength of the TextBox to match up my ViewModel (which could change since it is in a different assembly) and have it automatically set the max length based on the StringLength requirement?</p>