How does this translate C#->X#
Posted: Tue Sep 27, 2022 9:21 pm
This C# code:
in ILSpy translates as:
This gives Error XS1593 Delegate 'System.Windows.Threading.DispatcherOperationCallback' does not take 0 arguments
Indeed delegate (object parameter) from the C# code is missing. But I am not sure how to do this in X#
Anyone an idea?
Dick
Code: Select all
public static void ProcessUITasks()
// When called, forces the UI to redraw.
{
DispatcherFrame frame = new DispatcherFrame();
Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background, new DispatcherOperationCallback(delegate (object parameter) {
frame.Continue = false;
return null;
}), null);
Dispatcher.PushFrame(frame);
}
Code: Select all
public static method ProcessUITasks() as void
local frame as DispatcherFrame
frame := DispatcherFrame{}
Dispatcher.CurrentDispatcher:BeginInvoke(DispatcherPriority.Background, (DispatcherOperationCallback){ =>
frame:Continue := false
return null
}, null)
Dispatcher.PushFrame(frame)
Indeed delegate (object parameter) from the C# code is missing. But I am not sure how to do this in X#
Anyone an idea?
Dick