public void NotifyAbout(IViewElement message) { ViewExpensesInfo expensesInfo = (ViewExpensesInfo)message; if (expensesInfo != null) { expensesInfo.ExpensesType = EnumWorker.GetDescriptionFromValue(expensesInfo.ExpensesType); if (TabItemName == "Редактирование расхода") { ExpensesInfos.Add(expensesInfo); listOfViewObj.Add(expensesInfo); var deleteItem = listOfViewObj.FirstOrDefault(exp => exp.Id == SelectedExpensesInfo.Id); listOfViewObj.Remove(deleteItem); ExpensesInfos.Remove(SelectedExpensesInfo); SelectedExpensesInfo = expensesInfo; SetMaxExpensesValue(); TabVisibility = false; DisplayXamlTab = false; } else { ExpensesInfos.Add(expensesInfo); listOfViewObj.Add(expensesInfo); SetMaxExpensesValue(); TabVisibility = false; DisplayXamlTab = false; } } else { TabVisibility = false; DisplayXamlTab = false; } }
public IViewElement ConvertToVO() { return(new ViewExpensesInfo(Id, Expenditure, Comment, СostsDate.ToShortDateString(), EnumWorker.GetDescriptionFromValue(ExpensesType.ToString()))); }