title: How to create attached property of type 'Type'?
body: <p>Hi i tried to create an attached property of type <code>Type</code> looks like:</p>
  
  <pre><code>   public static Type GetTargetType(DependencyObject obj)
      {
          return (Type)obj.GetValue(TargetTypeProperty);
      }
  
      public static void SetTargetType(DependencyObject obj, Type value)
      {
          obj.SetValue(TargetTypeProperty, value);
      }
  
  
      public static readonly DependencyProperty TargetTypeProperty =
          DependencyProperty.RegisterAttached("TargetType", typeof(Type), typeof(MyHelper), new PropertyMetadata(null, OnTargetPropertyChanged));
  
      private static void OnTargetPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
      {
          // and here i want to use this type.
      }
  </code></pre>
  
  <p>and in the XAML Code:</p>
  
  <pre><code>// ...
       &lt;myControl MyHelpeers:MyHelper.TargetType="{x:Type local:myclass}"/&gt;
  //...
  </code></pre>
  
  <p>i googled about this i find a way to create the type form string. but i disliked that way.
  please help me.
  thanks.</p>