private void Lista_ItemSelected(object sender, SelectedItemChangedEventArgs e) { try { if (e.SelectedItem == null) { return; } var itemGrid = e.SelectedItem as VeiculoModel; if (itemGrid == null) { return; } frmVeiculoCad frm = new frmVeiculoCad(itemGrid); frm.Disappearing += frmVeiculoCad_Disappearing; Navigation.PushAsync(frm, true); grdVeiculos.SelectedItem = null; } catch (Exception ex) { DisplayAlert("Error", ex.Message + "\n\nTente novamente!", "OK"); grdVeiculos.SelectedItem = null; } finally { } }
private void BtnNovo_Clicked(object sender, EventArgs e) { try { frmVeiculoCad frm = new frmVeiculoCad(); frm.Disappearing += frmVeiculoCad_Disappearing; Navigation.PushAsync(frm, true); } catch (Exception ex) { DisplayAlert("Error", ex.Message + "\n\nTente novamente!", "OK"); } finally { } }