public static async void RunSync<TResult>(Func<TResult> funcation,Action<TResult> callback)
{
Func<System.Threading.Tasks.Task<TResult>> taskFun = () =>
{
return System.Threading.Tasks.Task.Run<TResult>(() =>
{
return funcation();
});
};
TResult result = await taskFun();
if (callback != null)
callback(result);
}