Getting Startedhttp://forums.silverlight.net//14.aspx/1?Getting+StartedThe perfect forum for asking the basic questions. No question too simple!Mon, 01 Jan 0001 00:00:00 -050014234848http://forums.silverlight.net//p/102984/234848.aspx/1?xmlns+xmlns+x+in+App+xamlxmlns xmlns:x in App.xaml <p>App.xaml:</p> <p>What are the meaning of&nbsp;xmlns xmlns:x?</p> <p>What is the differnce between&nbsp; xmlns=&quot;<a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation">http://schemas.microsoft.com/winfx/2006/xaml/presentation</a>&quot;<br> and&nbsp;xmlns=&quot;<a href="http://schemas.microsoft.com/client/2007">http://schemas.microsoft.com/client/2007</a>&quot;?</p> <p>Which is the correct one?</p> <p>Is xmlns:x=&quot;<a href="http://schemas.microsoft.com/winfx/2006/xaml">http://schemas.microsoft.com/winfx/2006/xaml</a>&quot;&nbsp;correct? Is there newer\better?</p> 2009-06-18T05:34:57-04:00235125http://forums.silverlight.net//p/102984/235125.aspx/1?Re+xmlns+xmlns+x+in+App+xamlRe: xmlns xmlns:x in App.xaml <p>Directly quoted from the <a href="http://msdn.microsoft.com/en-us/library/cc189061%28VS.95%29.aspx" target="_blank"> MSDN documentation</a>:</p> <p>Within the root element of many XAML files, there are two <span><span class="input">xmlns</span></span> declarations. The first declaration maps the overall Silverlight&nbsp;XAML namespace as the default:</p> <p><span class="code">xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</span> </p> <p>Note that this is the same XAML namespace that WPF uses as its default.</p> <p>The second declaration maps a separate XML namespace for XAML, mapping it (typically) to the <span><span class="input">x:</span></span> prefix: </p> <p><span class="code">xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;</span> </p> <p>The relationship between these declarations is that XAML is a language definition, and Silverlight&nbsp;is one implementation that uses XAML as a language. Silverlight in particular uses a strict subset of XAML. The XAML language specifies certain language elements, and each of these should be accessible through XAML processor implementations working against the XAML namespace.&nbsp;Silverlight&nbsp;also uses a subset of the set of elements that are in WPF.</p> <p>The Silverlight&nbsp;implementation of XAML and its intended programming model generally uses the default XML namespace&nbsp;for its own XAML vocabulary and uses a separate mapped prefix for the markup syntax expected in&nbsp;the Silverlight subset of the XAML namespace. By convention that prefix is <span><span class="input">x:</span></span>, and this same <span><span class="input">x:</span></span> convention is followed by project templates, sample code, and the documentation of language features within this documentation set. The XAML namespace defines several commonly&nbsp;used features that are necessary even for basic&nbsp;Silverlight-based applications. For instance, in order to join any code-behind to a XAML file through a partial class, you must name that class as the <a href="http://msdn.microsoft.com/en-us/library/cc189082%28VS.95%29.aspx" id="ctl00_MTContentSelector1_mainContentContainer_ctl08"> x:Class</a> attribute in the root element of the relevant XAML file. Or, any element as defined in a XAML page that you wish to access as a keyed resource in a <span><a href="http://msdn.microsoft.com/en-us/library/system.windows.resourcedictionary%28VS.95%29.aspx" id="ctl00_MTContentSelector1_mainContentContainer_ctl09">ResourceDictionary</a></span> must have the <a href="http://msdn.microsoft.com/en-us/library/cc189012%28VS.95%29.aspx" id="ctl00_MTContentSelector1_mainContentContainer_ctl10"> x:Key</a> attribute set on the object element in question.&nbsp; <br> </p> <p>&nbsp;</p> 2009-06-18T16:44:38-04:00235967http://forums.silverlight.net//p/102984/235967.aspx/1?Re+xmlns+xmlns+x+in+App+xamlRe: xmlns xmlns:x in App.xaml What is the differnce between xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot; and xmlns=&quot;http://schemas.microsoft.com/client/2007&quot;? 2009-06-21T05:52:37-04:00236026http://forums.silverlight.net//p/102984/236026.aspx/1?Re+xmlns+xmlns+x+in+App+xamlRe: xmlns xmlns:x in App.xaml <p>Hi,</p> <p>&nbsp;The note near the bottom of this msdn page should answer your question.</p> <p><a href="http://msdn.microsoft.com/en-us/library/cc189036(VS.95).aspx">http://msdn.microsoft.com/en-us/library/cc189036(VS.95).aspx</a></p> <p>&nbsp;</p> <table> <tbody> <tr> <th><img alt="Note" src="http://i.msdn.microsoft.com/Cc189036.alert_note(en-us,VS.95).gif"><strong>Note:</strong></th> </tr> <tr> <td> <p>In the Silverlight&nbsp;version&nbsp;1.0 era, the default XAML namespace used in templates for XAML was <span class="code"><font color="#000066" face="Courier New">http://schemas.microsoft.com/client/2007</font></span>. That namespace still has legacy support, but using <span class="code"><font color="#000066" face="Courier New">http://schemas.microsoft.com/winfx/2006/xaml/presentation</font></span> as the default namespace URI is strongly recommended for any current Silverlight XAML.&nbsp;This&nbsp;is for migration and tooling reasons: the <span class="code"><font color="#000066" face="Courier New">http://schemas.microsoft.com/winfx/2006/xaml/presentation</font></span> namespace is shared with WPF, and some tools may not account for the <span class="code"><font color="#000066" face="Courier New">http://schemas.microsoft.com/client/2007</font></span> namespace.</p> </td> </tr> </tbody> </table> 2009-06-21T15:03:06-04:00