|
using System.ComponentModel;
using Windows.UI;
namespace ClearStyle.ViewModel
{
/// <summary>
/// A single todo item.
/// </summary>
public class ToDoItem : INotifyPropertyChanged
{
private string _text;
private bool _completed;
private Color _color = Colors.Red;
public string Text
{
get { return _text; }
set
{
_text = value;
OnPropertyChanged("Text");
}
}
public string Description { get; set; }
public bool Completed
{
get { return _completed; }
set
{
_completed = value;
OnPropertyChanged("Completed");
}
}
public Color Color
{
get { return _color; }
set
{
_color = value;
OnPropertyChanged("Color");
}
}
public ToDoItem(string text)
{
Text = text;
Description = "Description ... " + System.Environment.NewLine + text;
}
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged(string property)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(property));
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.