rainmeter-studio/RainmeterStudio/Model/Property.cs

53 lines
1.3 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
2014-07-29 16:42:52 +00:00
using System.ComponentModel;
using System.Linq;
using System.Text;
namespace RainmeterStudio.Model
{
2014-07-29 16:42:52 +00:00
public class Property : INotifyPropertyChanged
{
2014-07-29 16:42:52 +00:00
/// <summary>
/// Gets or sets the name of the property
/// </summary>
public string Name { get; private set; }
private object _value;
2014-07-29 16:42:52 +00:00
/// <summary>
/// Gets or sets the value of the property
/// </summary>
public object Value
{
get
{
return _value;
}
set
{
_value = value;
2014-07-29 16:42:52 +00:00
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs("Value"));
}
}
2014-07-29 16:42:52 +00:00
/// <summary>
/// Triggered when the value changes
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
2014-07-29 16:42:52 +00:00
/// <summary>
/// Initializes this property
/// </summary>
/// <param name="name">Name of the property</param>
/// <param name="value">Value of the property</param>
public Property(string name, object value = null)
{
Name = name;
Value = value;
}
}
}