silverlight中页面导航 //导航到新页面,要是继承自Page的类中 private void NavigateToEditEvent(int eventId) { NavigationService.Navigate(new Uri("/EditEvent?EventID=" + eventId, UriKind.Relative)); } //ContentFrame是一个存放导航页的Frame容器 ContentFrame.Source = new Uri("/SizeChange/Example", UriKind.Relative); <navigation:Frame x:Name="ContentFrame" Style="{StaticResource ContentFrameStyle}" mce_Style="{StaticResource ContentFrameStyle}" Source="/Views/Home" Navigated="ContentFrame_Navigated" NavigationFailed="ContentFrame_NavigationFailed"> <navigation:Frame.UriMapper> <uriMapper:UriMapper> <uriMapper:UriMapping Uri="" MappedUri="/Views/Home.xaml"/> //导航至不同目录的时候Uri="/Views/{pageName}"最好写全 //同一目录下的时候可以略写成Uri="/{pageName}" //同时 Source="/Views/Home"可以略写成 Source="/Home" <uriMapper:UriMapping Uri="/Views/{pageName}" MappedUri="/Views/{pageName}.xaml"/> <uriMapper:UriMapping Uri="/SizeChange/{pageName}" MappedUri="/SizeChange/{pageName}.xaml"/> </uriMapper:UriMapper> </navigation:Frame.UriMapper> </navigation:Frame> //控件的目标要弄清楚TargetName="ContentFrame" <HyperlinkButton Content="入库" NavigateUri="/GoodsIn" TargetName="ContentFrame" Style="{StaticResource HLInAccordionStyle}" /> 写的不是很明确,但是最为自己的笔记,记录的是自己容易弄错的地方,足够啦。