title: How do I merge several observables using WhenAny(...) in ReactiveUI?
body: <p>I have a question which is an extension of the following question raised on this site.</p>
  
  <p><a href="https://stackoverflow.com/questions/8010372/is-there-a-more-elegant-way-to-merge-observables-when-return-type-is-unimportant/21762027#21762027">Is there a more elegant way to merge observables when return type is unimportant?</a></p>
  
  <p>I have an <code>IObservable&lt;Unit&gt;</code> (lets say <code>X</code>), a reactive collection (<code>Y</code>) and a property (<code>Z</code>). Return type is not important. I just want to subscribe when any of these change.</p>
  
  <p>I know how to observe all 3 and <code>Subscribe</code> using <code>Observable.Merge</code> as below.</p>
  
  <pre><code>Observable.Merge(X, Y.Changed, ObservableForProperty(Z).Select(_ =&gt; Unit.Default)).Subscribe(..)
  </code></pre>
  
  <p>And it works.</p>
  
  <p>However, when I try to use <code>WhenAny(...,....,....).Subscribe()</code>, the subscribe does not get triggered when my <code>X</code> changes. What is the syntax for doing the above using <code>WhenAny(...)</code> rather than <code>Observable.Merge(..)</code>?? </p>
  
  <p>I prefer to use <code>WhenAny(....)</code> because I am using <code>ReactiveUI</code> in other places.</p>
  
  <p>Example:
  Say I've got a class derived from <code>ReactiveObject</code> with following properties.</p>
  
  <pre><code>public class AnotherVM : ReactiveObject
  {
      public bool IsTrue
      {
          get { return this.isTrue; }
          set { this.RaiseAndSetIfChanged(x =&gt; x.isTrue, ref this.isTrue, value); }
      }
  
      public IObservable&lt;Unit&gt; Data
      {
          get { return this.data; }
      }
  
      public ReactiveCollection MyCol
      {
         get { return Mycol; }
      }    
  }
  
  public class MyVM : ReactiveObject
  {
      MyVM
      {
         // do WhenAny or Observable.Merge here....
      }
  }
  </code></pre>
  
  <p>I want to observe the above properties in <code>AnotherVM</code> class using <code>Observable.Merge(..)</code> or <code>WhenAny(...)</code> in <code>MyVM</code> class. I found that I do not always get a notification when I subscribe to the above in <code>MyVM</code> using <code>WhenAny(...)</code> or <code>Merge(...)</code> when either of the 3 properties change.</p>