title: WPF MVVM Databinding with parameters?
body: <p>So my previous question seem to not be answerable, so i'm going to give this a go with a suggestion of my own. </p>
  
  <p>The functionality im looking for, is having a datagrid change the Foreground (or even background) of a cell, when the data in that cell has been edited.</p>
  
  <p>My Model looks something like this:</p>
  
  <pre><code>Public class Shipment : PropertyChangedBase
  {
      #region Fields
      private ShippingService.Shipment.lbnshipment _localShipment;
      private ShippingService.Shipment.lbnshipment _originalShipment;
      #endregion
  
      #region Properties
      public int ShipmentID
      {
          get { return _localShipment.ShipmentID; }
          set
          {
              if(value != _localShipment.ShipmentID)
              {
                  _localShipment.ShipmentID = value;
                  NotifyOfPropertyChange(() =&gt; ShipmentID);
              }
           }
      } 
  
      public Shipment(ShippingServices.Shipment.lbnShipment localshipment)
      {
          _originalShipment = localshipment;
          _localShipment = localshipment;
      }
  
      //This Section is my best guess solution, but it just a guess
      public Color HasChanged(string Property)
      {
          switch(Property)
          {
             case "ShipmentID":
                 if(_localShipment.ShipmentID != _originalShipment.ShipmentID)
                 {
                    return Colors.Red;
                 } else {
                    return Colors.Black;
                 }
                 break;
          }
      }
  }
  </code></pre>
  
  <p>I've obviously stripped out most of the properties, and the HasChanged right now is pure myth, but what i'm hoping for is that somehow, i can bind a DataGridTextColumn Foreground(or background hopefully) to this HasChanged method, and somehow pass it which paramater is currently calling the method.</p>
  
  <pre><code>&lt;DataGridTextColumn Header="ShipmentID" Binding="{Binding ShipmentID}" Foreground="{Binding HasChanged}" /&gt;
  </code></pre>
  
  <p>I'm hoping there is some clever way for me to allow the binding to identify which property has changed, much in the same way that IDataErrorInfo allows validation to be bound per property. Although i have no idea how that actually functions in the background.</p>