Intersoft ClientUI 8 > ClientUI Fundamentals > Navigation Overview > Navigation How-to Topics > How-to: Configure URI Mapping using Type Name |
This example shows how to configure URI mapping to map a matching URI to a physical XAML based on the fully qualified type name of the XAML class.
By default, you create a user-friendly URIs by creating URI mapping that matches a friendly URI to a physical XAML based on the URI of the XAML. This is done by creating a new instance of UriMapper class and add any number of UriMapping instances to a frame. For more information about the basic concepts of ClientUI navigation framework, see Navigation Overview.
In certain cases, you may not be able to map a URI to a physical XAML based on its URI due to application modularity design. For example, the actual physical XAML is not contained in the same assembly that runs the Silverlight application. In such case, you can configure the UriMapping to match the physical XAML based on its fully qualified type name instead of its URI.
UXFrame supports the type name mapping using the same MappedUri property. Instead of setting the value to a URI like /Views/BookList.xaml, you set the MappedUri property to a value with the following pattern: /AssemblyName;FullyQualifiedTypeName.
The following example shows how to configure URI mapping to locate a physical XAML based on its fully qualified type name.
XAML |
Copy Code
|
---|---|
<Intersoft:UXFrame x:Name="ContentFrame" Source="/BookList"> <Intersoft:UXFrame.UriMapper> <Intersoft:UriMapper> <Intersoft:UriMapping Uri="/BookList" MappedUri="/SampleAssembly;SampleAssembly.Views.BookList"/> <Intersoft:UriMapping Uri="/Books/{ID}" MappedUri="/SampleAssembly;SampleAssembly.Views.BookDetails?ID={ID}"/> </Intersoft:UriMapper> </Intersoft:UXFrame.UriMapper> </Intersoft:UXFrame> |