.NET/Przepisy/Models/Recipe.cs
2019-06-02 10:23:04 +02:00

52 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Przepisy.Models
{
public class Recipe : INotifyPropertyChanged
{
private string name;
public string Name
{
get { return name; }
set { name = value; PropertyChange(nameof(Name)); }
}
private string description;
public string Description
{
get { return description; }
set { description = value; PropertyChange(nameof(Description)); }
}
public Recipe(string name, string description)
{
Name = name;
Description = description;
}
public event PropertyChangedEventHandler PropertyChanged;
private void PropertyChange(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}
}