title: Is it OK for property setters to have side effects with the MVVM pattern
body: <p>I'm writing WPF app which intend to solve standard problems. I'm really new to WPF and MVVM pattern, so there's a little mess in my head after reading tons of different approaches to MVVM on the internet. I'd like to know how my simple operation of DataGrid's itemsource refresh operation is "idiomatic" to MVVM. </p>
  
  <p>Let's say I have one datagrid and one combobox. The combo contains list of all coaches. The datagrid shows you all sportsmen trained by selected coach so the combo acts like a filter for data in datagrid:</p>
  
  <pre><code>&lt;ComboBox ItemsSource="{Binding ListCoach}" DisplayMemberPath="last_name" SelectedValue=
  "{Binding SelectedCoach}" SelectedValuePath="Id"/&gt;
  
  &lt;DataGrid ItemsSource="{Binding Path=ListSportsman}" .....  &lt;/DataGrid&gt;
  </code></pre>
  
  <p>My ViewModel class change content of the DataGrid in the <strong>setter</strong> of SelectedCoach property (this property is a target for Combobox's value):</p>
  
  <pre><code>  private int _selectedCoach;
    public int SelectedCoach
    {
       get { return _selectedCoach; }
       set
       {
          _selectedCoach = value;
          ListSportsman = new ObservableCollection&lt;sportsmanset&gt;(_serviceAgent.ListSportsmanOfCoach(value));
          NotifyPropertyChanged(vm =&gt; vm.SelectedCoach);
       }
    }
  </code></pre>
  
  <p>Doesn't such code smell? Or It would be more appropriate to subscribe for change in SelectedCoach property and set ListSportsman in separate function? (by the way, how to subscribe for NotifyPropertyChanged event manually?)</p>