title: Change GridViewColumn text color base on condition
body: <p>This is my <code>GridViewColumn</code>:</p>
  
  <pre><code>&lt;GridViewColumn Width="180" Header="Status"&gt;
      &lt;GridViewColumn.CellTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;TextBlock x:Name="Txt" Text="{Binding Status}" Foreground="Yellow" /&gt;
          &lt;/DataTemplate&gt;
      &lt;/GridViewColumn.CellTemplate&gt;
  &lt;/GridViewColumn&gt;
  </code></pre>
  
  <p>The Status <code>field</code> is a property of my binding object and all i want to do is change this <code>GridViewColumn</code> color but this time base on condition:</p>
  
  <p>I have another propgerty called <code>StatusMessage</code> which is simple <code>enum</code>:</p>
  
  <pre><code>public enum StatusMessage
  {
      InProcess,
      Done,
      Wait
  }
  </code></pre>
  
  <p>So this <code>enum</code> property is changing all the time and for every value of this <code>enum</code> i want to define different color.
  Is it possible ?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>My View model class inherit from <code>BaseObservableObject</code>:</p>
  
  <pre><code>public class BaseObservableObject : INotifyPropertyChanged
  {
      public event PropertyChangedEventHandler PropertyChanged;
  
      protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
      {
          var handler = PropertyChanged;
          if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
      }
  
      protected virtual void OnPropertyChanged&lt;T&gt;(Expression&lt;Func&lt;T&gt;&gt; raiser)
      {
          var propName = ((MemberExpression)raiser.Body).Member.Name;
          OnPropertyChanged(propName);
      }
  
      protected bool Set&lt;T&gt;(ref T field, T value, [CallerMemberName] string name = null)
      {
          if (!EqualityComparer&lt;T&gt;.Default.Equals(field, value))
          {
              field = value;
              OnPropertyChanged(name);
              return true;
          }
          return false;
      }
  }
  </code></pre>
  
  <p>My properties:</p>
  
  <pre><code>public string Status
  {
      get { return _status; }
      set
      {
          _status = value;
          OnPropertyChanged();
      }
  }
  
  public StatusMsg StatusMessage
  {
      get { return _statusMsg; }
      set {
          _statusMsg = value;
          OnPropertyChanged();
      }
  }
  </code></pre>
  
  <p>XAML:</p>
  
  <pre><code>&lt;GridViewColumn Width="180" Header="Status" DisplayMemberBinding="{Binding Status}"&gt;
      &lt;GridViewColumn.CellTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;TextBlock Foreground="{Binding StatusMsg,Converter={c:StatusMessageToColorConverter}}" /&gt;
          &lt;/DataTemplate&gt;
      &lt;/GridViewColumn.CellTemplate&gt;
  &lt;/GridViewColumn&gt;
  </code></pre>
  
  <p><code>StatusMessageToColorConverter</code> is the same as @grek40 suggested and still my <code>TextBlock</code> <code>Foreground</code> not changing.</p>