title: Use reflection to reset all dependency properties back to their default?
body: <p>I know it is possible to use reflection to access all dependency properties on a given class. But is it possible to use reflection, or some other generic technique, to set all dependency properties back to the default value that was given when the property was registered?</p>
  
  <p>example dp:</p>
  
  <pre><code>public static readonly DependencyProperty IdProperty = DependencyProperty.Register("Id", typeof(int?), typeof(OwnerClass), new PropertyMetadata(0));
  public int? Id { get { return (int?)GetValue(IdProperty); } }
  </code></pre>
  
  <p>Can I loop through all such dps in any given class and set them back to the value given by the original PropertyMetadata object?</p>
  
  <p>My purpose is to try and create a "Clear()" method in an abstract base class for all viewmodels in a wpf application. I would like to give Clear() the default behavior of setting all dps that might be registered back to the default value given when registered. The user can override this behavior when/if needed.</p>