title: MVVM viewmodel property triggering update
body: <p>I started implementing MVVM for one of my Silverlight applications.
  (I'm not using any toolkit).</p>
  
  <p>My page contains a section with two combo boxes. Selecting an item in one of these combos triggers a search that updates a grid visible below the combos.</p>
  
  <p>Each combo's selected item is bound to a property in my view model. The setter of these properties raise the INotifyPropertyChanged property change and updates the data bound to the grid automatically.</p>
  
  <p>Everything was fine until I needed to add a reset button which purpose is to reset the search parameters i.e.: each combo box should not indicate any item and the grid should be empty.</p>
  
  <ul>
  <li>If the reset function in the viewmodel updates the backing fields, the UI won't reflect the changes as RaisePropertyChanged will not be called.</li>
  <li>If the reset function in the viewmodel updates the properties, the UI will reflect the changes but the grid will be updated twice: when reseting the first property to null and also for the second</li>
  </ul>
  
  <p>Any help appreciated</p>
  
  <pre><code>/// &lt;summary&gt;Selected user.&lt;/summary&gt;
  public User SelectedUser
  {
      get { return _selectedUser; }
      set
      {
          _selectedUser = value;
          RaisePropertyChanged("SelectedUser");
  
          UpdateProducts();
      }
  }
  
  /// &lt;summary&gt;Selected product category.&lt;/summary&gt;
  public ProductCategory SelectedProductCategory
  {
      get { return _selectedProductCategory; }
      set
      {
          _selectedProductCategory = value;
          RaisePropertyChanged("SelectedProductCategory");
  
          UpdateProducts();
      }
  }
  
  // Reset option 1
  public void Reset()
  {
      _selectedUser = null;
      _selectedProductCategory = null;
      _products = null;
  }
  
  // Reset option 2
  public void Reset()
  {
      SelectedUser = null;
      SelectedProductCategory = null;
      // No need to update Products which has already been updated twice...
  }
  </code></pre>