private void StartTestDataGrid() { IsTestDataGrid = false; Random ran = new Random(); int[] seeds = new int[] { 1, 2, 4, 8, 16 }; Thread ts = new Thread(new ThreadStart(() => { while (!IsTestDataGrid) { TestLogData l = new TestLogData() { Data = "12345567890", Tag = "Testing", LocalTimestamp = DateTime.Now, SourceBuffer = (LogBuffer)seeds[ran.Next(4)] }; ReceivedLogDataForDataGrid(l); Thread.Sleep(100); } })); ts.Start(); }
public void ReceivedLogDataForListView(TestLogData log) { System.Windows.Application.Current.Dispatcher.Invoke(() => { LogCollectionForListView.Add(log); SelectedItemForListView = LogCollectionForListView[LogCollectionForListView.Count - 1]; }); }