Esempio n. 1
0
        private void SubEventGrid_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Down)
            {
                var currentRowIndex = (_viewModel.SelectedDetailRow.SubEventList.IndexOf(_viewModel.SelectedRequestForSampleEvent));
                if (currentRowIndex == (_viewModel.SelectedDetailRow.SubEventList.Count - 1))
                {
                    _viewModel.AddNewSubEventRow(true);
                }
            }

            else if (e.Key == Key.Delete)
            {
                _viewModel.SelectedRequestForSampleEvents.Clear();
                foreach (var row in SubEventGrid.SelectedItems)
                {
                    _viewModel.SelectedRequestForSampleEvents.Add(row as TblRequestForSampleEventViewModel);
                }

                _viewModel.DeleteRequestForSampleEventRow();
            }
        }