<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Marius Bancila's Blog &#187; URI</title>
	<atom:link href="http://mariusbancila.ro/blog/tag/uri/feed/" rel="self" type="application/rss+xml" />
	<link>http://mariusbancila.ro/blog</link>
	<description>Sharing my opinions and ideas!</description>
	<lastBuildDate>Fri, 06 Apr 2012 13:45:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Reference a XAML From Another Project</title>
		<link>http://mariusbancila.ro/blog/2009/08/26/reference-a-xaml-from-another-project/</link>
		<comments>http://mariusbancila.ro/blog/2009/08/26/reference-a-xaml-from-another-project/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 08:20:21 +0000</pubDate>
		<dc:creator>Marius Bancila</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[XAML]]></category>
		<category><![CDATA[assembly]]></category>
		<category><![CDATA[URI]]></category>

		<guid isPermaLink="false">http://mariusbancila.ro/blog/?p=363</guid>
		<description><![CDATA[When you create a WPF application, the start-up window is by default one from the same project (by default called Window1.xaml). < Application x:Class="WpfApplication1.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="Window1.xaml" > < Application.Resources > < /Application.Resources > < /Application > But what if you want to use a window from another project (class library)? The pack URI scheme, [...]]]></description>
			<content:encoded><![CDATA[<p>When you create a WPF application, the start-up window is by default one from the same project (by default called Window1.xaml). </p>
<pre class="prettyprint">
< Application x:Class="WpfApplication1.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    StartupUri="Window1.xaml" >
    < Application.Resources >

    < /Application.Resources >
< /Application >
</pre>
<p>But what if you want to use a window from another project (class library)? The pack URI scheme, used by WPF, allows you to identify and load files from:</p>
<ul>
<li>the current assembly</li>
<li>a referenced assembly</li>
<li>a location relative to an assembly</li>
<li>the site of origin for the application</li>
</ul>
<p>The format of the pack URI is <strong><em>pack://authority/path</em></strong>. The authority identifies the type of package and the path the location of a part inside a package. There are two authorities supported by WPF:</p>
<ul>
<li>application:/// identifies application data files (known at compile time)</li>
<li>siteoforigin:/// identifies site of origin files</li>
</ul>
<p>To use resource files from a referenced assembly you need to use the application:/// authority, and the path must have the form <strong><em>AssemblyShortName[;Version][;PublicKey];</em>component/<em>Path</em></strong>. Version and PublicKey are optional.</p>
<p>Let&#8217;s say you want to use a XAML called SampleWindow.xaml from a referenced assembly called WpfDemoLib. The App.xaml file should look like this:</p>
<pre class="prettyprint">
< Application x:Class="WpfApplication1.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    StartupUri="pack://application:,,,/WpfDemoLib;component/SampleWindow.xaml" >
    < Application.Resources >

    < /Application.Resources >
< /Application >
</pre>
<p>You can learn more about pack URIs in WPF from <a href="http://msdn.microsoft.com/en-us/library/aa970069.aspx" target="_blank">MSDN</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mariusbancila.ro/blog/2009/08/26/reference-a-xaml-from-another-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

