私はWp7アプリに取り組んでいます。ここでは、uriMapperを使用して、条件に応じてユーザーを開始ページに誘導しています。
そしてその条件は、
登録している場合は、mypage2.xaml に直接移動する必要があります。登録していない場合は、mypage1.xaml に移動する必要があります。
これを解決するために、app.xaml で UriMapper を使用しました
<uriMapper:UriMapper x:Name="mapper">
<uriMapper:UriMapping Uri="/InermediatePage.xaml" />
</uriMapper:UriMapper>
InermediatePage.xaml は、何もしない単なる中間ページです。
app.xaml.cs のコンストラクター内の私のコードは LoadActivePage(); です。
private void LoadActivePage()
{
UriMapper mapper = Resources["mapper"] as UriMapper;
RootFrame.UriMapper = mapper;
if(ifNotRegistered)
{
mapper.UriMappings[0].MappedUri= new Uri("/mypage1.xaml",UriKind.Relative);
}
else
{
mapper.UriMappings[0].MappedUri= new Uri("/mypage2.xaml",UriKind.Relative);
}
}
今問題は、デバッグするときです..正常に動作します。
しかし、アプリが廃棄され、エミュレーターまたはデバイスでアプリを再起動すると、mypage1.xaml または mypage2.xaml を表示する代わりに Inermediatepage.xaml が表示されます