private void btnNovo_Click(object sender, RoutedEventArgs e) { var formCadastroDivida = new FormCadastroDeDivida(); formCadastroDivida.ShowDialog(); CarregueElementosDoBancoDeDados(); }
private void btnEditar_Click(object sender, RoutedEventArgs e) { if (lstDividas.SelectedItem == null) { MessageBox.Show("Selecione um item na lista"); } else { var itemSelecionado = (Divida)lstDividas.SelectedItem; var formCadastroDividae = new FormCadastroDeDivida(itemSelecionado); formCadastroDividae.ShowDialog(); CarregueElementosDoBancoDeDados(); } }