title: How to design a WPF dependency property to support the path to image?
body: <p>To describe my problem i have created a small application.
  At first the Usercontrol:</p>
  
  <pre><code>&lt;UserControl x:Class="WpfApplication10.UserControl1"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      x:Name="This" DataContext="{Binding ElementName=This}"
      &gt;    
      &lt;Image Source="{Binding Path=MyImageSource}" &gt;&lt;/Image&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>second the TestApp:</p>
  
  <pre><code>&lt;Window x:Class="WpfApplication10.Window1"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:WpfApplication10="clr-namespace:WpfApplication10"
      Title="Window1" Height="300" Width="300"&gt;
      &lt;WpfApplication10:UserControl1
          MyImageSource="c:\test.png" &gt;        
      &lt;/WpfApplication10:UserControl1&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>third the code behind the usercontrol</p>
  
  <pre><code>using System.Windows;
  using System.Windows.Controls;
  using System.Windows.Media.Imaging;
  namespace WpfApplication10
  {
      public partial class UserControl1 : UserControl
      {
          public static readonly DependencyProperty MyImageSourceProperty =
              DependencyProperty.Register("MyImageSource", 
                   typeof(BitmapImage),typeof(UserControl1),
                   new FrameworkPropertyMetadata((BitmapImage)new BitmapImage(),
                        FrameworkPropertyMetadataOptions.None
                   ));
  
          public BitmapImage MyImageSource
          {
              get { return (BitmapImage)GetValue(MyImageSourceProperty); }
              set { SetValue(MyImageSourceProperty, value); }
          }
  
  
          public UserControl1()
          {
              InitializeComponent();
          }
      }
  }
  </code></pre>
  
  <p>I know that the Type BitMapImage (of the DP) doesnt work in this way, but i want to know how to implement this feature in a clean, typesave way. 
  I want to reach the same behaviour like the original Image.Source implementation.</p>
  
  <p>thanks in advance, Scott</p>