|
using System.Collections.ObjectModel;
using System.Linq;
namespace SelectionAreaSample
{
public sealed class DataItem : Observable
{
#region Constructors
public DataItem()
{
Items = new ObservableCollection<DataItem>();
PanelType = 1;
LassoType = 1;
SelectionType = 1;
}
#endregion Constructors
#region Public Properties
public ObservableCollection<DataItem> Items { get; private set; }
public int Type { get; set; }
public int PanelType
{
get
{
return panelType;
}
set
{
base.RaisePropertyChanged(() => PanelType, ref panelType, value);
}
}
public int LassoType
{
get
{
return lassoType;
}
set
{
base.RaisePropertyChanged(() => LassoType, ref lassoType, value);
Items.ToList().ForEach(a => a.LassoType = value);
}
}
public int SelectionType
{
get
{
return selectionType;
}
set
{
base.RaisePropertyChanged(() => SelectionType, ref selectionType, value);
Items.ToList().ForEach(a => a.SelectionType = value);
}
}
public bool IsSelected
{
get
{
return isSelected;
}
set
{
base.RaisePropertyChanged(() => IsSelected, ref isSelected, value);
}
}
public bool Scoped
{
get
{
return scoped;
}
set
{
base.RaisePropertyChanged(() => Scoped, ref scoped, value);
Items.ToList().ForEach(a => { a.Scoped = value; a.IsSelected = false; });
}
}
public double Left { get; set; }
public double Top { get; set; }
public double Width { get; set; }
public double Height { get; set; }
#endregion Public Properties
#region Private Fields
private int panelType;
private int lassoType;
private int selectionType;
private bool isSelected;
private bool scoped;
#endregion Private Fields
}
}
|
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.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.