Prev | Current Page 112 | Next

Matthew MacDonald

"Pro WPF with VB 2008: Windows Presentation Foundation with .NET 3.5"

In this example, this namespace is declared without a namespace prefix, so
it becomes the default namespace for the entire document. In other words, every element
is automatically placed in this namespace unless you specify otherwise.
??? http://schemas.microsoft.com/winfx/2006/xaml is the XAML namespace. It includes
various XAML utility features that allow you to influence how your document is interpreted.
This namespace is mapped to the prefix x. That means you can apply it by
placing the namespace prefix before the element name (as in ).
As you can see, the XML namespace name doesn??™t match any particular .NET namespace.
There are a couple of reasons the creators of XAML chose this design. By convention, XML
namespaces are often URIs (as they are here). These URIs look like they point to a location on
the Web, but they don??™t. The URI format is used because it makes it unlikely that different
organizations will inadvertently create different XML-based languages with the same namespace.
Because the domain schemas.microsoft.com is owned by Microsoft, only Microsoft will
use it in an XML namespace name.
The other reason that there isn??™t a one-to-one mapping between the XML namespaces
used in XAML and .NET namespaces is because it would significantly complicate your XAML
documents.


Pages:
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124