开发者

How to navigate without HyperlinkButton beatween two pages?

I created two pages on my scratch silverlight application. The two pages are appear on the mainPage ( mainPage is a UserControl ). Now, i want to see the page1 on the top and navigate to page2.

I can't add HyperlinkButton.

How can i add the page 2 ? And how can i navigate to page2 from page 1 ( can be from the mainPage that contain the page1 & page2 )

I try evrything and nothing work.

The code

<navigation:Frame x:Name="FrameNavigator" Source="/Views/page1.xaml" >

   开发者_StackOverflow中文版// need somehow to add here page2 

</navigation:Frame>


Are you trying to show both pages at once? And why do you not want to us a Hyperlink button. If you want the user to be able to click on something and go to page2, but you don't want it to look like a HyperlinkButton, you can replace the Content of the HyperlinkButton.

<HyperlinkButton.Content>
    <Image ... /> <!-- or whatever --/>
</HyperlinkButton.Content>

If for whatever reason you don't want to use HyperlinkButton, you can navigate from code.

FrameNavigator.Navigate(uri);

Please be more specific as to what you are trying to do and I can give a better answer.


Thanks,

I solve this problem in this way

Frame2.Navigate(new Uri("/Page1.xaml", UriKind.Relative));


Use Button Control for this

On click event you can navigate page in frameby

NavigationFrame.Navigate(uri)

try this


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

I am new to xaml and am just now starting to realize the design capabilitys so I do everything else in the code behind just make sure you have

using System.Windows.Navigation
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜