void SalesView_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { try { if (e != null && e.Action == NotifyCollectionChangedAction.Add) { if (e.NewItems != null && e.NewItems.Count > 0) { if (SalesLst != null) { SalesLst.ScrollIntoView(e.NewItems[0]); SalesLst.SelectedItem = e.NewItems[0]; } } SalesVM.Instance.TransactionData.CurrentTransactionEntry = (PrescriptionEntry)SalesLst.SelectedItem; } else if (e.Action == NotifyCollectionChangedAction.Reset) { SetUpSalesPad(); // SalesLst_SelectionChanged(null, null); } } catch (Exception ex) { Logger.Log(LoggingLevel.Error, GetCurrentMethodClass.GetCurrentMethod() + ": --- :" + ex.Message + ex.StackTrace); throw ex; } }
void SalesView_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { if (e.Action == NotifyCollectionChangedAction.Add) { SalesLst.ScrollIntoView(e.NewItems[0]); SalesLst.SelectedItem = e.NewItems[0]; salesvm.TransactionData.CurrentTransactionEntry = (RMSDataAccessLayer.TransactionEntryBase)SalesLst.SelectedItem; padPos = PadPosition.Middle; } }
void SalesView_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { if (e.Action == NotifyCollectionChangedAction.Add) { SalesLst.ScrollIntoView(e.NewItems[0]); SalesLst.SelectedItem = e.NewItems[0]; salesvm.CurrentTransactionEntry = (RMSDataAccessLayer.TransactionEntryBase)SalesLst.SelectedItem; } else if (e.Action == NotifyCollectionChangedAction.Reset) { SetUpSalesPad(); // SalesLst_SelectionChanged(null, null); } }