title: How to: Override Metadata for a Dependency Property
body: <p>how to override default dependency property metadata.
  for example ;Text property for textbox.
  i use this code </p>
  
  <pre><code>           class UCTextBox : TextBox
         {
             public UCTextBox()
          {
         var defaultMetadata = TextBox.TextProperty.GetMetadata(typeof(TextBox));
  
         TextBox.TextProperty.OverrideMetadata(typeof(UCTextBox),
       new          FrameworkPropertyMetadata(string.Empty,
          FrameworkPropertyMetadataOptions.Journal | 
       FrameworkPropertyMetadataOptions.BindsTwoWayByDefault,
          defaultMetadata.PropertyChangedCallback,
          new CoerceValueCallback(CoerceText)
          )); 
  }
  
      private static object CoerceText(DependencyObject d, object value)
       {
       return   value.ToString().Replace(",","");           
      }
  </code></pre>
  
  <p>but this In both runs(get,set)</p>
  
  <p>No one can help me!!!:(((</p>