80 lines
1.4 KiB
C#
80 lines
1.4 KiB
C#
using System.ComponentModel;
|
|
using BeWo.ViewModel;
|
|
using BS.Shared.DataContracts;
|
|
|
|
namespace BeWo.Core
|
|
{
|
|
public class TextModuleTreeItem : INotifyPropertyChanged
|
|
{
|
|
public TextModuleTreeItem(TextModuleVM pVM)
|
|
{
|
|
TextModuleVM = pVM;
|
|
}
|
|
|
|
private BindingList<TextModuleTreeItem> _Children;
|
|
|
|
private bool _IsExpanded;
|
|
|
|
|
|
public TextModuleVM TextModuleVM { get; set; }
|
|
|
|
public string ItemName
|
|
{
|
|
get
|
|
{
|
|
return TextModuleVM != null ? TextModuleVM.Name : null;
|
|
}
|
|
|
|
set
|
|
{
|
|
if(TextModuleVM != null)
|
|
{
|
|
TextModuleVM.Name = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
public bool IsExpanded
|
|
{
|
|
get { return _IsExpanded; }
|
|
|
|
set
|
|
{
|
|
_IsExpanded = value;
|
|
RaisePropertyChanged("IsExpanded");
|
|
}
|
|
}
|
|
|
|
public bool IsCaption
|
|
{
|
|
get { return TextModuleVM != null && TextModuleVM.Parent != null; }
|
|
}
|
|
|
|
public BindingList<TextModuleTreeItem> Items
|
|
{
|
|
get { return _Children ?? (_Children = new BindingList<TextModuleTreeItem>()); }
|
|
|
|
set { _Children = value; }
|
|
}
|
|
|
|
public int Position
|
|
{
|
|
get { return TextModuleVM != null ? TextModuleVM.Position : 0; }
|
|
}
|
|
|
|
public ServiceCategoryDC ServiceCategory
|
|
{
|
|
get { return TextModuleVM != null ? TextModuleVM.ServiceCategory : null; }
|
|
}
|
|
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|
|
|
protected void RaisePropertyChanged(string propertyName)
|
|
{
|
|
if(PropertyChanged != null)
|
|
{
|
|
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
|
|
}
|
|
}
|
|
}
|
|
} |