using System.ComponentModel; using BS.Shared; using BeWo.ViewModel; using BS.Shared.DataContracts.ClientPartials; namespace BeWo.Core { public class SupportConceptGoalTreeItem : SupportConceptGoalDC { private ValueListEntryVM _GoalEntryVM; private BindingList _Children; public ValueListEntryVM GoalEntryVM { get { return _GoalEntryVM; } set { _GoalEntryVM = value; } } public string ItemName { get => _GoalEntryVM != null ? _GoalEntryVM.Description : GoalEntryDC?.TypeDescription; set { if (_GoalEntryVM != null) { _GoalEntryVM.Description = value; } if (GoalEntryDC != null) { GoalEntryDC.TypeDescription = value; } } } public string Notice { get => _GoalEntryVM != null ? _GoalEntryVM.Notice : GoalEntryDC?.Notice; set { if(_GoalEntryVM != null) { _GoalEntryVM.Notice = value; } if(GoalEntryDC != null) { GoalEntryDC.Notice = value; } } } public bool IsGoal { get { return GoalEntryVM != null ? GoalEntryVM.Type.Equals(ValueListEntryType.SupportConceptGoalType) || GoalEntryVM.Type.Equals(ValueListEntryType.SupportConceptIndividualGoalType) : GoalEntryDC.Type.Equals(ValueListEntryType.SupportConceptGoalType) || GoalEntryDC.Type.Equals(ValueListEntryType.SupportConceptIndividualGoalType); } } public BindingList Items { get { return _Children ?? (_Children = new BindingList()); } set { _Children = value; } } public ValueListEntryType GoalType { get { return GoalEntryDC == null ? GoalEntryVM.Type : GoalEntryDC.Type; } } } }