

The pack URI for a resource file that is compiled into the local assembly uses the following authority and path: WPF supports the construction of pack URIs that can be used to identify resource files that are either compiled into the local assembly or compiled into an assembly that is referenced from the local assembly. Resource files are configured as MSBuild Resource items and are compiled into assemblies.
#Wpf mvvm wmv player how to#
The following sections explain how to construct pack URIs using these two authorities in conjunction with the appropriate paths for identifying resource, content, and site of origin files. Additionally, the "/" character must be replaced with the "," character, and reserved characters such as "%" and "?" must be escaped.

The authority component of a pack URI is an embedded URI that points to a package and must conform to RFC 2396. The scope of each authority is shown in the following figure. The siteoforigin:/// authority identifies site of origin files. The application:/// authority identifies application data files that are known at compile time, including resource and content files.

To access these types of files, WPF supports two authorities: application:/// and siteoforigin:///. Resource files that are compiled into a referencing assembly. Resource files that are compiled into a referenced assembly. Resource files that are compiled into the local assembly. Packages and parts are analogous to applications and files, where an application (package) can include one or more files (parts), including: This concept is illustrated by the following figure: The authority specifies the type of package that a part is contained by, while the path specifies the location of a part within a package. The following is the format for a pack URI. The pack URI scheme uses "pack" as its scheme, and contains two components: authority and path. The scheme that is specified by a URI is defined by its prefix http, ftp, and file are well-known examples. To identify parts, the OPC specification leverages the extensibility of RFC 2396 (Uniform Resource Identifiers (URI): Generic Syntax) to define the pack URI scheme. The following figure illustrates this concept. The key elements of this model are packages and parts, where a package is a logical container for one or more logical parts. The pack URI scheme is used by the Open Packaging Conventions (OPC) specification, which describes a model for organizing and identifying content. This topic provides an overview of the scheme, covers how to construct pack URIs for a variety of scenarios, discusses absolute and relative URIs and URI resolution, before showing how to use pack URIs from both markup and code. To provide a consistent mechanism for identifying and loading these types of files from these locations, WPF leverages the extensibility of the pack URI scheme. Specifying the user interface (UI) to show when an application first starts.įurthermore, URIs can be used to identify and load files from a variety of locations, including the following:

#Wpf mvvm wmv player windows#
In Windows Presentation Foundation (WPF), uniform resource identifiers (URIs) are used to identify and load files in many ways, including the following:
