45 lines
1014 B
C#
45 lines
1014 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MVVM_DEMO.Models
|
|
{
|
|
public class Product
|
|
{
|
|
private string _productName;
|
|
private decimal _productPrice;
|
|
|
|
public string ProductName
|
|
{
|
|
get => _productName;
|
|
set
|
|
{
|
|
_productName = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
public decimal ProductPrice
|
|
{
|
|
get => _productPrice;
|
|
set
|
|
{
|
|
_productPrice = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|
|
|
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
|
{
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
}
|
|
|
|
}
|
|
}
|