title: Setting Property in Data Context from Action/Command
body: <p>I have a <code>DataTrigger</code> in my XAML which is binded to a Property, 'ShowEffect' in my ViewModel class. I also have a button which is binded to a <code>RelayCommand</code> (class shown below) that calls a method. In that method, I set 'ShowEffect' to true. However, the <code>DataTrigger</code> does not seem to respond; the effect is not shown:</p>
  
  <p>I declare the Property using:</p>
  
  <pre><code>private Boolean _ShowEffect;
      public Boolean ShowEffect
      {
          get { return _ShowEffect; }
          set { _ShowEffect = value; }
      }
  </code></pre>
  
  <p><strong><code>RelayCommand</code> Class:</strong></p>
  
  <pre><code>public class RelayCommand : ICommand
  {
      public RelayCommand(Action&lt;object&gt; execute)
          : this(execute, null)
      {
      }
      public RelayCommand(Action&lt;object&gt; execute, Predicate&lt;object&gt; canExecute)
      {
          if (execute == null)
              throw new ArgumentNullException("execute");
          _execute = execute;
          _canExecute = canExecute;
      }
      public bool CanExecute(object parameter)
      {
          return _canExecute == null ? true : _canExecute(parameter);
      }
      public event EventHandler CanExecuteChanged
      {
          add { CommandManager.RequerySuggested += value; }
          remove { CommandManager.RequerySuggested -= value; }
      }
      public void Execute(object parameter)
      {
          _execute(parameter);
      }
      private readonly Action&lt;object&gt; _execute;
      private readonly Predicate&lt;object&gt; _canExecute;
  }
  </code></pre>
  
  <p>I'm wondering whether the issue is related to the dispatcher. Can anyone suggest why the binding isn't working when I set the property in the method called by the command? It works when I set the property anywhere else in  the ViewModel.</p>