public void UpdateExpenses(object parameter) { Window window = new View.EditExpenses(); window.DataContext = new EditExpensesViewModel(db, SelectedExpenses, Id); window.Title = "Изменить"; window.ShowDialog(); }
public void AddExpenses(object parameter) { Window window = new View.EditExpenses(); window.DataContext = new EditExpensesViewModel(db, null, Id); window.Title = "Добавление"; window.ShowDialog(); ExpensesSource = new ObservableCollection <Expenses>(db.Expenses.Where(i => i.User.Id == Id).ToList()); }