title: WPF using MVVM: DataBinding with RelativeSource
body: <p>I have a control and within that control I have a resource with a data tempalte: </p>
  
  <pre><code>  &lt;DataTemplate DataType="{x:Type local:FlowModel}"&gt;
      &lt;Image Source="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type vm:MainViewModel}}, Path=MainViewModel.ImagePath}"/&gt;
    &lt;/DataTemplate&gt;
  
   xmlns:vm="clr-namespace:CortexMonitoringTool.ViewModel"
  </code></pre>
  
  <p>I have vm set to my ViewModel folder, I am implementing mvvm. I cannot get my binding to work and I am unsure why not. </p>
  
  <p>Can some tell me if my relative binding is correct, if it can actually see my property 'ImagePath' in my MainViewModel class?</p>
  
  <pre><code>public String ImagePath
      {
          get
          {
              return _imagePath;
          }
          set
          {
              if (_imagePath == value)
              {
                  return;
              }
              _imagePath = value;
              RaisePropertyChanged("ImagePath");
          }
      }
  </code></pre>
  
  <p>Thank you.</p>