title: Re-reading binding value on Command execution
body: <p>Let's say I have a button like this:</p>
  
  <pre><code>&lt;Button x:Name="DeleteItem" Content="Delete item" Height="20" Width="100" Margin="0,0,10,0" VerticalAlignment="Top" HorizontalAlignment="Left" 
                  Command="{Binding DeleteItem}" CommandParameter="{Binding Path=SelectedItem, ElementName=MainWindowObject}"/&gt;
  </code></pre>
  
  <p>MainWindowObject is the Window in which this button resides, so the CommandParameter binding is reading the value of the 'SelectedItem' property I made in the code-behind which looks like this:</p>
  
  <pre><code>public object SelectedItem
      {
          get
          {
              switch (CurrentTab)
              {
                  case TabType.Author:
                      return this.AuthorGrid.SelectedItem;
                  default: // BookGrid is the default grid
                      return this.BookGrid.SelectedItem;
              }
          }
      }
  </code></pre>
  
  <p>Basically it should get the grid's current selected item. The reason why I just don't read the value directly using "Binding ElementName=Grid, Path=SelectedItem" or something like that is because the grid that it will choose in the switch depends on the 'CurrentTab' property, which is another property that tells me which TabItem is the active one in a TabControl.</p>
  
  <p>The <strong>problem</strong> I'm having is that the program reads the 'SelectedItem' value once on startup and every time I call the Command it uses that old, stale value. What I need is for it to re-run the 'SelectedItem' property every time the command runs so it gets a new, fresh value.</p>
  
  <p><em>So basically I need to know how to update the binding's value dynamically every time the Command gets called. Anyone know how I can do something like that declaratively without making a mess in my codebehind?</em></p>