I would suggest you replace your product class with the following:
private class PRODUCT : INotifyPropertyChanged
{
int _quantity;
public int Quantity
{
get { return _quantity; }
set
{
if (_quantity != value)
{
_quantity = value;
OnPropertyChanged("Quantity");
OnPropertyChanged("Pay");
}
}
}
int _prices;
public int Prices
{
get{ return _prices; }
set
{
if (_prices != value)
{
_prices = value;
OnPropertyChanged("Prices");
OnPropertyChanged("Pay");
}
}
}
int _pay;
public int Pay
{
get { return _quantity * _prices; }
}
void OnPropertyChanged(string prop)
{
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(prop));
}
public event PropertyChangedEventHandler PropertyChanged;
}
I would also change this binding by removing the update attribute as below:
<datagridtextcolumn binding="{Binding Pay}" header="Pay" width="60" isreadonly="True" />
As for an explanation, at no point were you telling your GUI to update. To have to call your "OnPropertyChanged" event with the name of the properties that have been updated. When you have a lot of calculated properties this can be a pain, although there are advised solutions around that allow you to partially automate that process.