Exemplo n.º 1
0
        private void CellEditEnding(DataGridCellEditEndingEventArgs e)
        {
            var columnDisplayIndex = (DataGridColumns)e.Column.DisplayIndex;

            if (DataGridSelectedItem is Transaction selectedTransaction)
            {
                if (columnDisplayIndex == DataGridColumns.MoneySourceField)
                {
                    if (!SourceItems.Contains(selectedTransaction.MoneySource))
                    {
                        SourceItems.Add(selectedTransaction.MoneySource);
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void LoadBase()
        {
            var baseItems = db.GetItems();

            ExpensesItems.Clear();
            foreach (var transaction in baseItems)
            {
                ExpensesItems.Add(transaction);
                if (!SourceItems.Contains(transaction.MoneySource))
                {
                    SourceItems.Add(transaction.MoneySource);
                }
            }
            RaisePropertyChanged(nameof(ExpensesItems));
        }