4a4fc708c7
Add AutoMapper and INotifyPropertyChanged to enable cart quantity changes to be reflected
37 lines
1013 B
C#
37 lines
1013 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace RMWPFUserInterface.Models
|
|
{
|
|
public class ProductDisplayModel : INotifyPropertyChanged
|
|
{
|
|
public int Id { get; set; }
|
|
public string ProductName { get; set; }
|
|
public string Description { get; set; }
|
|
public decimal RetailPrice { get; set; }
|
|
private int _quantityInStock;
|
|
|
|
public int QuantityInStock
|
|
{
|
|
get { return _quantityInStock; }
|
|
set
|
|
{
|
|
_quantityInStock = value;
|
|
CallPropertyChanges(nameof(QuantityInStock));
|
|
}
|
|
}
|
|
|
|
public bool IsTaxable { get; set; }
|
|
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|
public void CallPropertyChanges(string propertyName)
|
|
{
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
}
|
|
}
|
|
}
|