private void Window_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.F6) { m_fieldsPopup = new AjusteDialog(); //m_fieldsPopup = new CompraDialog(m_productList); m_fieldsPopup.CloseRequested += myDialog_CloseRequested; m_fieldsPopup.UpdateRequested += myDialog_UpdateRequested; m_fieldsPopup.Activated += fieldsPopup_Opened; m_fieldsPopup.Background = new SolidColorBrush(Colors.Red); RootGrid.Opacity = 0.1; m_fieldsPopup.Opacity = 1; m_fieldsPopup.ShowDialog(); RootGrid.Opacity = 1; } if (e.Key == Key.F7) { tabla.Rows[m_selectedIndex].Delete(); if (m_selectedIndex == -1) { return; } RemoveItem(m_selectedIndex); this.DeleteButton.IsEnabled = false; } }
private void Add(object sender, RoutedEventArgs e) { m_fieldsPopup = new AjusteDialog(); //m_fieldsPopup = new CompraDialog(m_productList); m_fieldsPopup.CloseRequested += myDialog_CloseRequested; m_fieldsPopup.UpdateRequested += myDialog_UpdateRequested; m_fieldsPopup.Activated += fieldsPopup_Opened; m_fieldsPopup.Background = new SolidColorBrush(Colors.Red); RootGrid.Opacity = 0.1; m_fieldsPopup.Opacity = 1; m_fieldsPopup.ShowDialog(); RootGrid.Opacity = 1; }
private void InvoiceGrid_DoubleTapped(object sender, System.Windows.Input.MouseButtonEventArgs e) { FrameworkElement element = null; if ((element = e.OriginalSource as FrameworkElement) != null) { m_selectedIndex = Grid.GetRow(element); } AjusteItem invoiceItem = m_items[m_selectedIndex]; //esta no estaba comentada int selectedProductIndex = m_productList.IndexOf(m_productList[invoiceItem.Descripcion]); m_fieldsPopup = new AjusteDialog(invoiceItem, "Edit the Fields"); m_fieldsPopup.UpdateRequested += EditDialog_UpdateRequested; m_fieldsPopup.CloseRequested += EditDialog_CloseRequested; m_fieldsPopup.lblTitle.Content = "Editar Articulos"; RootGrid.Opacity = 0.2; m_fieldsPopup.Opacity = 1; m_fieldsPopup.ShowDialog(); RootGrid.Opacity = 1; }