public async Task TestRenderUIElementAsync()
        {
            var taskSource = new TaskCompletionSource <object>();
            await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal, async() =>
            {
                try
                {
                    var file = await _storageService.CreateOrGetFileAsync(TEST_FILE_PATH);
                    using (var stream = await file.OpenAsync(FileAccessMode.ReadWrite))
                    {
                        var uiElement          = new SampleControl300();
                        RenderTargetBitmap res = await _graphicsService.RenderToStreamAsync(uiElement, stream, BitmapEncoder.PngEncoderId);

                        Assert.IsNotNull(res);     // fails, because the UI element has to be added to the visual tree before
                        Assert.AreEqual(300, res.PixelHeight);
                        Assert.AreEqual(300, res.PixelWidth);
                    }

                    taskSource.SetResult(null);
                }
                catch (Exception e)
                {
                    taskSource.SetException(e);
                }
            });

            await taskSource.Task;
        }