private void btNovo_Click(object sender, RoutedEventArgs e) { formCadastroUsuarios formUsuarios = new formCadastroUsuarios(); formUsuarios.ShowDialog(); CarregarLista(); }
private void btEditar_Click(object sender, RoutedEventArgs e) { if (listUsuarios.SelectedItem == null) { MessageBox.Show("Favor selecionar um item para edicao!", "Atencao", MessageBoxButton.OK, MessageBoxImage.Error); } else { var usuario = (Usuario)listUsuarios.SelectedItem; var formCadastroProdutos = new formCadastroUsuarios(usuario); formCadastroProdutos.ShowDialog(); } CarregarLista(); }