Click or drag to resize
CanvasAnimatedControlCreateResources Event
Hook this event to create any resources needed for your drawing.

Namespace:  Microsoft.Graphics.Canvas.UI.Xaml
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version:
public event TypedEventHandler<CanvasAnimatedControl, CanvasCreateResourcesEventArgs> CreateResources


Type: Windows.FoundationTypedEventHandlerCanvasAnimatedControl, CanvasCreateResourcesEventArgs



The CreateResources event is raised once when the CanvasAnimatedControl is first initialized, then again any time the resources need to be recreated, for instance if the underlying GPU gets reset.

The Update and Draw events will not be raised until CreateResources (or any asynchronous operations it tracks) has completed.

See the remarks section of ICanvasAnimatedControl for more details.

The CreateResources event is raised on XAML's UI thread.

If your app cannot be structured in a way where it loads all of its resources at the beginning (for example, a game with multiple levels, and the levels require different assets), see Loading Resources outside of CreateResources for more information.

See Also