In This Article

ResourceHelper Class

Represents a collection of helper methods when working with resources.

public static class ResourceHelper
Inheritance:
Object Object

Methods

GetLocationUri(Assembly, String)

Returns a pack Uri based on the specified parameters, that can be used to construct a Uri.

public static Uri GetLocationUri(Assembly assembly, string relativeLocation)
Parameter Type Description
assembly Assembly

The Assembly that contains the resource.

relativeLocation String

The relative location of the resource file within the assembly. The location must start NOT with a /, and should be the location from the root of the assembly like:

Themes/AnimatedProgressBar/AeroNormalColor.xaml
.

Returns

Uri:

A pack Uri.

GetLocationUri(Assembly, String, Boolean, Boolean)

Returns a pack Uri based on the specified parameters, that can be used to construct a Uri.

public static Uri GetLocationUri(Assembly assembly, string relativeLocation, bool includePackPrefix, bool includeAssemblyVersion)
Parameter Type Description
assembly Assembly

The Assembly that contains the resource.

relativeLocation String

The relative location of the resource file within the assembly. The location must start NOT with a /, and should be the location from the root of the assembly like:

Themes/AnimatedProgressBar/AeroNormalColor.xaml
.
includePackPrefix Boolean

if set to true then the pack URI prefix will be included.

includeAssemblyVersion Boolean

if set to true then the assembly's version will be included.

Returns

Uri:

A pack Uri.

GetLocationUriString(Assembly, String)

Returns a string-representation of a pack URI based on the specified parameters, that can be used to construct a Uri.

public static string GetLocationUriString(Assembly assembly, string relativeLocation)
Parameter Type Description
assembly Assembly

The Assembly that contains the resource.

relativeLocation String

The relative location of the resource file within the assembly. The location must start NOT with a /, and should be the location from the root of the assembly like:

Themes/AnimatedProgressBar/AeroNormalColor.xaml
.

Returns

String:

A string-representation of a pack URI.

GetLocationUriString(Assembly, String, Boolean, Boolean)

Returns a string-representation of a pack URI based on the specified parameters, that can be used to construct a Uri.

public static string GetLocationUriString(Assembly assembly, string relativeLocation, bool includePackPrefix, bool includeAssemblyVersion)
Parameter Type Description
assembly Assembly

The Assembly that contains the resource.

relativeLocation String

The relative location of the resource file within the assembly. The location must start NOT with a /, and should be the location from the root of the assembly like:

Themes/AnimatedProgressBar/AeroNormalColor.xaml
.
includePackPrefix Boolean

if set to true then the pack URI prefix will be included.

includeAssemblyVersion Boolean

if set to true then the assembly's version will be included.

Returns

String:

A string-representation of a pack URI.

GetLocationUriStringBase(Assembly)

Returns a string-representation of a base pack URI based on the specified parameters, that can be used to construct a Uri.

public static string GetLocationUriStringBase(Assembly assembly)
Parameter Type Description
assembly Assembly

The Assembly that contains the resource.

Returns

String:

A string-representation of a base pack URI.

Inherited Members