ログインしているユーザーを特定のページにリダイレクトするアプリケーションがあります。Silverlightの子ページからの移動
私の問題は、子ウィンドウからエラーメッセージが表示されていることです::: MainPage mp =(MainPage)Application.Current.RootVisual;この場合、どのようにリダイレクトできますか?
/// <summary>
/// Navigate to page that user is most likely to use.
/// </summary>
private static void NavigateToUserPage()
{
// Get logged in Role
User user = WebContext.Current.User;
// Count if collection > 1
List<string> roles = new List<string>(user.Roles);
if (roles.Count > 1)
{
// goto roles pages to select the user role
}
else
{
switch (roles[0])
{
case "SiteAdmin":
Uri uriSiteAdmin = new Uri("OwnerOccupier", UriKind.Relative);
MainPage mp = (MainPage)Application.Current.RootVisual;
mp.ContentFrame.Navigate(uriSiteAdmin);
break;
case "OwnerOccupier":
Uri uriOwner = new Uri("OwnerOccupier", UriKind.Relative);
MainPage p = (MainPage)Application.Current.RootVisual;
p.ContentFrame.Navigate(uriOwner);
break;
default:
break;
}
}
}
エラーに関するヘルプが必要な場合は、エラーの詳細を含めると役立ちます。 – AnthonyWJones