Hello all,
in my scenario I've c# library (DLL) that implements my protocol functions, as following:
public Read(...) { .. .. myThread = new Thread(this.TraceThreadProc); .. .. myThread.Start(tParams); }
protected override void TraceThreadProc(object data) { .. .. do { .. .. // Call event on client program about every 20msec OnReadFrameReady(..) } while (stopRequest == false); .. // Communicate to client that read is terminated ! OnReadComplete(..); }
In my MainWindowViewModel, receive for every frame, one event from DLL protocol that contains different field as (IdFrame, Variable1, Variable 2, ... Variable N°).
I want display this data into a DataGrid, that have a maximum number of rows (for example 20, one row in one data contains in event receveid); How can I stored this data into ObservableCollection ? (believe thread-safe, because the events run in a different thread). This collection must be limited to a fixed number element.
Is it possible remove every row added in datagrid the first row to obtain a scroll effect ?
Stefano