using System; using System.ComponentModel; using System.Windows; using System.Windows.Media; namespace PRSDesktop { public class OrgChartEntry : INotifyPropertyChanged { private string _background = "#00000000"; private string _color = "#00000000"; private Guid _id = Guid.Empty; private ImageBrush _image = new(); private Guid _imageid = Guid.Empty; private string _name; private Guid _parentid = Guid.Empty; private string _position; private bool _visible; public Guid ID { get => _id; set { if (_id != value) { _id = value; OnPropertyChanged("ID"); } } } public Guid ParentID { get => _parentid; set { if (_parentid != value) { _parentid = value; OnPropertyChanged("ParentID"); } } } public string Position { get => _position; set { if (_position != value) { _position = value; OnPropertyChanged("Position"); } } } public string Name { get => _name; set { if (_name != value) { _name = value; OnPropertyChanged("Name"); } } } public Guid ImageID { get => _imageid; set { if (_imageid != value) { _imageid = value; OnPropertyChanged("ImageID"); } } } public ImageBrush Image { get => _image; set { if (_image != value) if (value != null) { _image = value; OnPropertyChanged("Image"); } } } public Visibility ImageVisible => _imageid != Guid.Empty ? Visibility.Visible : Visibility.Collapsed; public string Color { get => _color; set { if (_color != value) if (value != null) { _color = value; OnPropertyChanged("Color"); } } } public bool Visible { get => _visible; set { if (_visible != value) { _visible = value; OnPropertyChanged("Visible"); } } } public string WarningColor { get => _background; set { if (_background != value) if (value != null) { _background = value; OnPropertyChanged("WarningColor"); } } } public event PropertyChangedEventHandler PropertyChanged; private void OnPropertyChanged(string name) { if (PropertyChanged != null) PropertyChanged.Invoke(this, new PropertyChangedEventArgs(name)); } } }