private async void Button_Click(object sender, RoutedEventArgs e)
        {
#if __WASM__
            Uno.Foundation.WebAssemblyRuntime.InvokeJS("Uno.UI.Demo.Analytics.reportPageView('benchmark');");
#endif

            RayTraceBenchmark.Console.WriteLineCallback = print;
            BenchmarkMain.SaveImageCallback             = showImage;
            await BenchmarkMain.Start();
        }
        private void showImage(byte[] data)
        {
            var bitmap      = new WriteableBitmap(Benchmark.Width, Benchmark.Height);
            var pixelBuffer = bitmap.PixelBuffer;
            var stream      = pixelBuffer.AsStream();

            data = BenchmarkMain.ConvertRGBToBGRA(data);
            stream.Write(data, 0, data.Length);
            stream.Flush();
            image.Source = bitmap;
        }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     RayTraceBenchmark.Console.WriteLineCallback = print;
     BenchmarkMain.SaveImageCallback             = showImage;
     BenchmarkMain.Start();
 }