【发布时间】:2011-03-10 06:09:02
【问题描述】:
在我的应用程序中,我这样做是为了在 app.xaml.cs 中映射我的 uri,现在的问题是,如果我的应用程序在 MainPage.xaml 而不是 Eula.xaml 上停用我的应用程序退出。否则,应用程序将在其启动的同一页面上退出。
在 App.xaml 中
<UriMapper:UriMapper x:Name="mapper">
<UriMapper:UriMapping Uri="/MainPageOrEULA.xaml"/>
</UriMapper:UriMapper>
在 App.xaml.cs 中
// Get the UriMapper from the app.xaml resources, and assign it to the root frame
UriMapper mapper = Resources["mapper"] as UriMapper;
RootFrame.UriMapper = mapper;
// Update the mapper as appropriate
IsolatedStorageFile isoStorage = IsolatedStorageFile.GetUserStoreForApplication();
if (isoStorage.FileExists("DataBase/MyPhoneNumber.txt"))
{
mapper.UriMappings[0].MappedUri = new Uri("/MainPage.xaml", UriKind.Relative);
}
else
{
mapper.UriMappings[0].MappedUri = new Uri("/EULA.xaml", UriKind.Relative);
}
请指导我。
问候,
华丽。
【问题讨论】:
-
UriMappers 不打算以这种方式使用。你到底想达到什么目的?
-
@Matt Lacey,我正在尝试在第一次启动应用程序时启动我的 EULA.xaml 页面,并且在我想从 MainPage.xaml 启动我的应用程序之后,我得到了这个功能,但是根据认证指南,应用程序应该在正确启动的页面上退出,它的工作方式很明智,但是如果我的应用程序墓碑,则后退导航的行为类似于 Mainpage->FirstPage->Exit,它应该类似于 MainPage->EULA->Exit。谢谢..
-
@Matt Lacey, stackoverflow.com/questions/4463085/…
标签: windows-phone-7