深入探索Silverlight导航系统:从基础到高级应用
1. URI映射
在某些情况下,你可能不想让页面名称在URI中过于明显,或者想要使用更易记、易输入的URI。这时,就可以使用URI映射来定义更简单的URI,使其映射到标准版本的URI。
1.1 添加UriMapper对象
首先,需要在XAML资源中添加一个 UriMapper 对象。通常,会在主页面或 App.xaml 文件的资源集合中定义它,示例代码如下:
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Navigation.App"
xmlns:navigation="clr-namespace:System.Windows.Navigation;assembly=System.Windows.Controls.Navigation">
<Application.Resources>
<navigation:UriMapper x:Key="PageMapper">
</navigation:UriMapper>
</Application.Resources>
&
超级会员免费看
订阅专栏 解锁全文
46

被折叠的 条评论
为什么被折叠?



