private void Canvas_CreateResources(Microsoft.Graphics.Canvas.UI.Xaml.CanvasControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args)
        {
            // Create instance of radial gradient brush; the center will be transparent and the extremes opaque black.
            radialBrush = new CanvasRadialGradientBrush(sender, Colors.Transparent, Colors.Black);

            // Load image to draw.
            args.TrackAsyncAction(Task.Run(async () =>
            {
                image = await CanvasBitmap.LoadAsync(sender, new Uri("ms-appx:///SpotlightImage.png"));
            }).AsAsyncAction());
        }
        private void canvasControl_CreateResources(CanvasControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args)
        {
            CreateSizeDependentResources();

            if (ThumbnailGenerator.IsDrawingThumbnail)
            {
                args.TrackAsyncAction(LoadThumbnailResources(sender).AsAsyncAction());
            }
        }
 private void canvasMain_CreateResources(CanvasAnimatedControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args)
 {
     args.TrackAsyncAction(CreateResourcesAsync(sender).AsAsyncAction());
 }
        private void canvasControl_CreateResources(CanvasControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args)
        {
            CreateSizeDependentResources();

            if (ThumbnailGenerator.IsDrawingThumbnail)
            {
                args.TrackAsyncAction(LoadThumbnailResources(sender).AsAsyncAction());
            }

            needToCreateSizeDepdendentResources = false;

            if(args.Reason != CanvasCreateResourcesReason.FirstTime)
            {
                needsInkSurfaceValidation = true;
            }
        }
 private void ImageVirtualControl_CreateResources(CanvasVirtualControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args)
 {
     if (imageStream != null)
     {
         args.TrackAsyncAction(LoadVirtualBitmap().AsAsyncAction());
     }
 }
        private void Canvas_CreateResources(CanvasAnimatedControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args)
        {

            args.TrackAsyncAction(PrepareRainday(sender).AsAsyncAction());
        }