using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using RainmeterStudio.Core.Model;
namespace RainmeterStudio.UI.ViewModel
{
///
/// Contains the view model of a reference
///
public class ReferenceViewModel : INotifyPropertyChanged
{
#region Properties
///
/// Gets the linked reference
///
public Tree Reference { get; private set; }
///
/// Gets or sets the name
///
public string Name
{
get
{
return Reference.Data.Name;
}
}
///
/// Gets or sets the path
///
public string Path
{
get
{
return Reference.Data.StoragePath;
}
}
private bool _isExpanded = true;
///
/// Gets or sets a property indicating if the tree view item is expanded
///
public bool IsExpanded
{
get
{
return _isExpanded;
}
set
{
_isExpanded = value;
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs("IsExpanded"));
}
}
private bool _isSelected;
///
/// Gets or sets a property indicating if the tree view item is selected
///
public bool IsSelected
{
get
{
return _isSelected;
}
set
{
_isSelected = value;
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs("IsSelected"));
}
}
#endregion
#region Events
///
/// Event triggered when a property is changed
///
public event PropertyChangedEventHandler PropertyChanged;
#endregion
#region Constructor
///
/// Creates a new instance of reference view model
///
/// Reference
public ReferenceViewModel(Tree reference)
{
Reference = reference;
}
#endregion
}
}