简体   繁体   English

如何从全景应用中打开一个简单的页面?

[英]How can i open up a simple page from my panorama app?

I have a panorama app and made a button on one of the pages. 我有一个全景应用程序,并在其中一个页面上做了一个按钮。 How can open up a page when the user clicks the button? 如何在用户点击按钮时打开页面?

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            SearchPage sp = new SearchPage();
            sp.Visibility = System.Windows.Visibility.Visible;

Now, the sp.Visibility seems to be the wrong way to go about it. 现在, sp.Visibility似乎是错误的方法。 Could anyone help me figuring out how I show secondary pages? 任何人都可以帮我弄清楚我如何显示辅助页面?

当你说一个页面时,你的意思是申请中的panoramaitem或新页面?

Just like web applications, in your silverlight application you need to redirect the user to the next page. 就像Web应用程序一样,在Silverlight应用程序中,您需要将用户重定向到下一页。

NavigationService.Navigate(new Uri("/SearchPage.xaml", UriKind.Relative);

you can pass parameters to your page by adding query string parameters: 您可以通过添加查询字符串参数将参数传递到您的页面:

NavigationService.Navigate(new Uri("/SearchPage.xaml?name=" + txtName.Text, UriKind.Relative);

and in SearchPage.cs you can retrieve the query string by saying this: SearchPage.cs您可以通过这样说来检索查询字符串:

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
    var name = NavigationContext.QueryString["name"];
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在我的应用中打开锁定屏幕设置页面? - How can I open up lock screen settings page in my app? 当用户单击外部来源的链接时,如何在应用程序中打开特定页面? - How can I open a specific page in my app when the user clicks a link from an outside source? 如何在不使用导航的情况下在 Xamarin 应用程序中打开页面? - How can I open page in my Xamarin app without using navigation? 如何在WinForms应用程序中打开网页,同时将浏览器保留在后台? - How can I open a web page from a WinForms app, while keeping the browser in the background? 如何从另一个页面导航到指定的全景项目 - How to navigate to specified panorama item from another page 从“全景页面”导航到非全景页面(列表项) - Navigate from Panorama Page to a non-Panorama Page (listitems) 如何在全景页面和新页面(非全景)之间导航 - How to navigate between panorama page and a new page (non panorama) 如何从aspx网页在客户端计算机上调用Win应用程序? - How can I call a win app on client machine from my aspx web page? 如何使TextCell的Tapped事件打开另一个页面? - How can I make the Tapped event of a TextCell open up another page? 如何防止DataGridView行向上移动? - How can I prevent my DataGridView rows from moving up?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM