WPF learning path (13) URL, wpf learning path url
A URL consists of three parts: Protocol, host address of the resource, and resource path.
In WPF, URLs are also composed of three parts: pack, authority (application: | siteoforigin :), and Path
Resource file
Local Assembly
Uri uri = new Uri ("pack: // application:,/ResourceFile. xaml", UriKind. Absolute );
Uri uri = new Uri ("pack: // application:,/Subfolder/ResourceFile. xaml", UriKind. Absolute );
Referenced assembly
Uri uri = new Uri ("pack: // application:,/ReferencedAssembly; component/ResourceFile. xaml", UriKind. Absolute );
Uri uri = new Uri ("pack: // application:,/ReferencedAssembly; component/Subfolder/ResourceFile. xaml", UriKind. Absolute );
Uri uri = new Uri ("pack: // application:,/ReferencedAssembly; v1.0.0.0; component/ResourceFile. xaml", UriKind. Absolute );
Content File
Uri uri = new Uri ("pack: // application:,/ContentFile. xaml", UriKind. Absolute );
Uri uri = new Uri ("pack: // application:,/Subfolder/ContentFile. xaml", UriKind. Absolute );
Uri uri = new Uri ("pack: // siteoforigin:,/SOOFile. xaml", UriKind. Absolute); source site file
Uri uri = new Uri ("pack: // siteoforigin:,/Subfolder/SOOFile. xaml", UriKind. Absolute );
Relative URL
Uri uri = new Uri ("/ResourceFile. xaml", UriKind. Relative );
Uri uri = new Uri ("/Subfolder/ResourceFile. xaml", UriKind. Relative );
Uri uri = new Uri ("/ReferencedAssembly; component/ResourceFile. xaml", UriKind. Relative );
Uri uri = new Uri ("/ReferencedAssembly; component/Subfolder/ResourceFile. xaml", UriKind. Relative );
Uri uri = new Uri ("/ContentFile. xaml", UriKind. Relative );
Uri uri = new Uri ("/Subfolder/ContentFile. xaml", UriKind. Relative );
The above content is reproduced from the http://zhxh1012.blog.163.com/blog/static/140866457201191752652161/
MSDN https://msdn.microsoft.com/zh-cn/library/aa970069 (v = vs.110). aspx
To be continue...