title: Wrap Observable.FromEventPattern with Observable.Create
body: <p>Which is the difference between this (taken from <a href="https://github.com/LeeCampbell/RxCookbook/blob/master/Model/PropertyChange.md" rel="nofollow noreferrer">RxCookbook on GitHub</a>):</p>
  
  <pre><code>public static IObservable&lt;TProperty&gt; OnPropertyChanges&lt;T, TProperty&gt;(this T source, Expression&lt;Func&lt;T, TProperty&gt;&gt; property)
      where T : INotifyPropertyChanged
  {
      return  Observable.Create&lt;TProperty&gt;(o=&gt;
      {
          var propertyName = property.GetPropertyInfo().Name;
          var propertySelector = property.Compile();
  
          return Observable.FromEventPattern&lt;PropertyChangedEventHandler, PropertyChangedEventArgs&gt;(
                          handler =&gt; handler.Invoke,
                          h =&gt; source.PropertyChanged += h,
                          h =&gt; source.PropertyChanged -= h)
                      .Where(e =&gt; e.EventArgs.PropertyName == propertyName)
                      .Select(e =&gt; propertySelector(source))
                      .Subscribe(o);
      });
  }
  </code></pre>
  
  <p>And this (written by myself):</p>
  
  <pre><code>public static IObservable&lt;TProperty&gt; OnPropertyChanges&lt;T, TProperty&gt;(this T source, Expression&lt;Func&lt;T, TProperty&gt;&gt; property)
      where T : INotifyPropertyChanged
  {
      var propertyName = property.GetPropertyInfo().Name;
      var propertySelector = property.Compile();
  
      return Observable.FromEventPattern&lt;PropertyChangedEventHandler, PropertyChangedEventArgs&gt;(
                      handler =&gt; handler.Invoke,
                      h =&gt; source.PropertyChanged += h,
                      h =&gt; source.PropertyChanged -= h)
                  .Where(e =&gt; e.EventArgs.PropertyName == propertyName)
                  .Select(e =&gt; propertySelector(source));
  }
  </code></pre>
  
  <p>I think that in the second block of code, <code>propertyName</code> and <code>propertySelector</code> will be evaluated when <code>OnPropertyChanges</code> is called and in the first block these variables will be evaluated every time someone subscribes to the observable. However, I can't figure out if/why the first block is preferrable to the second one, and why did the author of the first block decided to use <code>Observable.Create</code>.</p>