I have been looking for a solution to this problem for a long time without success.
I am porting part of my C # code to F # and I am struggling with Dispatcher.Invoke for a WPF element. Since I'm a complete noob in F #, the only thing I'm sure is that the problem is between the chair and the keyboard.
Here is my C # code:
foreach (var k in ChartList.Keys) { ChartList[k].Dispatcher.Invoke( System.Windows.Threading.DispatcherPriority.Normal, new Action( delegate() { ChartList[k].Width = area.Width / totalColsForm; ChartList[k].Height = area.Height / totalRowsForm; ChartList[k].Left = area.X + ChartList[k].Width * currentCol; ChartList[k].Top = area.Y + ChartList[k].Height * currentRow; ChartList[k].doShow(); } )); }
The part I'm struggling with is the new action (delegate () ...). The compiler did not like any of my attempts to translate it.
What will be the translation of this fragment in F #?
Anass source share