title: Data Validation in Silverlight 4
body: <p>I have control in SL4. I want data validation on button click. Big problem is normally SL4 give validation using binding property.</p>
  
  <p>like example given shown in this example</p>
  
  <p><a href="http://weblogs.asp.net/dwahlin/archive/2010/08/15/validating-data-in-silverlight-4-applications-idataerrorinfo.aspx" rel="nofollow noreferrer">http://weblogs.asp.net/dwahlin/archive/2010/08/15/validating-data-in-silverlight-4-applications-idataerrorinfo.aspx</a></p>
  
  <pre><code>&lt;TextBox Text="{Binding Name,Mode=TwoWay,ValidatesOnDataErrors=true}" 
      Height="23" 
      Width="120"
      HorizontalAlignment="Left" 
      VerticalAlignment="Top"    /&gt;
  </code></pre>
  
  <p>BUT I WANT TO SHOW ERROR MESSAGE LIKE THIS ....</p>
  
  <p><img src="https://i.stack.imgur.com/WvATl.png" alt="enter image description here"></p>
  
  <p>using my own code like on button click i check
   (textbox1.text == null ) then set this style of error to textbox1</p>