Specifies a hint for how a resource should be managed in memory.

These settings are suggestions for how a resource may be loaded into memory, how it may be kept in memory, and when it can be unloaded. How these suggestions are interpreted will ultimately depend on the specific resource and what type it is.

Location

Namespace
Fuse.Resources
Package
Fuse.Common 2.9.1
Show Uno properties and methods

Interface of MemoryPolicy

AllowPinnedFree : bool ux

Allows a resource that is currently in use to be freed. For very static display components this can often work since the visuals may be cached anyway.

BundlePreload : bool ux

Specifies that a resource loaded from a bundle should be loaded as soon as possible during application startup.

PreloadRetain : MemoryPolicy uno

This policy causes the resource to be loaded when the application starts and keep it in memory as long as possible.

QuickUnload : MemoryPolicy uno

This policy causes the resource to be loaded as required and then unloads it as soon as possible when no longer required (after a timeout of 1s). This is useful when you have several images being loaded dynamically one after the other in your app.

UnloadInBackgroundPolicy : MemoryPolicy uno

Unloads the resource only when going into the background. This is meant primarily for internal resource use, where there is an alternate mechanism for cleaning unused items. Using it on high level resources, like Image, might cause memory exhaustion problems.

UnloadUnused : MemoryPolicy uno

This policy causes the resource to be loaded as required and then unloads it when no longer required (after a timeout of 60s).

UnpinInvisible : bool ux

Specifies that a resource which is currently not visible (hidden), can be unpinned, and thus released.

Inherited from object

Attached UX Attributes

GlobalKey (attached by Resource) : string ux

The ux:Global attribute creates a global resource that is accessible everywhere in UX markup.