I have a background thread updating an array. At timed intervals I call myDataGrid.Items.Refresh(). However nothing changes on the screen. But when I for instance click on the column heading of the data grid on the screen the information is actualized immediately.
I like to see the changes on the screen at timed intervals, for instance every 2 seconds. What am I missing?
Here is the code fragment in F# that shows the situation:
... let win = new Window() let grid = DataGrid() grid.HeadersVisibility <- DataGridHeadersVisibility.All grid.ItemsSource <- myArray win.Content <- new ScrollViewer(Content=grid) win.Show() ... // Background thread A // updating myArray ... // Background thread B let updateDataGrid = grid.Items.Refresh() Thread.Sleep(5000) updateDataGrid ... [<STAThread>] do let app = new Application() app.Run() |> ignore