title: Binding on CollectionViewSource -> View -> Groups -> Count (Code vs XAML)
body: <p>I'm trying to bind to a CollectionViewSource nested property (CVS.View.Groups.Count) and it doesn't seem to work in code :</p>
  
  <pre><code>Binding binding = new Binding();
  binding.Path = new PropertyPath("View.Groups.Count");
  binding.Mode = BindingMode.OneWay;
  binding.Source = CVS;
  BindingOperations.SetBinding(this, ValueProperty, binding);
  </code></pre>
  
  <p>But it's working well in WPF/xaml. </p>
  
  <pre><code>&lt;DataTrigger Binding="{Binding Path=CVS.View.Groups.Count, Mode=OneWay}" Value="1"&gt;
  </code></pre>
  
  <p>So I'm wondering what is the difference between these both approach and what is wrong in code way binding. Meanwhile this kind of code is working well on no-nested property when it's a simple dependency property in a dependency object, so I suppose there is a problem with provided PropertyPath..</p>
  
  <p>Any help would be appreciated.</p>