private void BillMod_Click(object sender, RoutedEventArgs e) { if (BillDisplay.SelectedItem is Bill) { Bill selectedBill = BillDisplay.SelectedItem as Bill; BillWindow billWindow = new BillWindow(viewModel.BinList.ToList(), selectedBill.BinToRemoveFrom, selectedBill.Name, selectedBill.DueDate, selectedBill.Description, selectedBill.Amount); if (billWindow.ShowDialog() == true) { viewModel.ModBill(selectedBill, billWindow.BillName, billWindow.SelectedDate.Value, billWindow.BillDescription, billWindow.BillAmount); } } }
private void BillAdd_Click(object sender, RoutedEventArgs e) { if (viewModel.BinList.Count <= 0) { return; } BillWindow billWindow = new BillWindow(viewModel.BinList.ToList(), null); if (billWindow.ShowDialog() == true) { viewModel.AddBill(billWindow.BillName, billWindow.SelectedDate.Value, billWindow.BillDescription, billWindow.BillAmount, billWindow.BinToRemoveFrom); } }