private void Window_PreviewKeyDown(object sender, KeyEventArgs e) { if (BtnSave.Content.ToString().Trim() == "Nuevo") return; if (e.Key == Key.F5 && BtnSave.Content.ToString().Trim() == "Guardar") { if (e.Key == System.Windows.Input.Key.F5) { BtnSave.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); return; } } }
private void Window_PreviewKeyDown(object sender, KeyEventArgs e) { try { if (e.Key == Key.F5) { BtnSave.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); } } catch (Exception w) { SiaWin.Func.SiaExeptionGobal(w); MessageBox.Show("error en el key down" + w); } }