I looked for a solution to this problem for a long time without success.
I am porting some of my C# code to F# and I am struggling with a Dispatcher.Invoke for a WPF element. Since I am a total noob in F#, the only thing that I am sure of is that the problem is located 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 am struggling with is the new Action(delegate() ... ). The compiler did not like any of my attempts to translate it.
What would be the translation of this snippet in F#?