Skip to main content
Home Forums General Silverlight New Features in Silverlight 3 Navigating from a frame to another frame using code-behind
2 replies. Latest Post by Min-Hong Tang - MSFT on November 18, 2009.
(0)
johngumboc
Member
0 points
1 Posts
11-13-2009 6:39 AM |
Does anybody know how to duplicate this in code?
<HyperlinkButton NavigateUri="/ComingSoon" Content="Page Name" Style="{StaticResource PageHyperlinkButtonStyle}" TargetName="ContentFrame" />
I am navigating from a second frame(which contains a sub menu) to a (content frame). The XAML works perfect, but I need to loan a XAP file first and then Navigate to the "ContentFrame".
So I need to Navigate after the code below which is in another XAML Page, so the FrameName.Navigate (new Uri("Page.xaml",UriKind.Relative)) method doesn't work because "FrameName" is not in the same page.
{
K2P2
Participant
1028 points
337 Posts
11-13-2009 6:34 PM |
Just a wild shot - can you send a local message to whoever has access to FrameName?
LocalMessageSender localMessageSender = new LocalMessageSender ( "FrameListener" );localMessageSender .SendAsync ( "NavigateTo,Page.xaml");
void FrameListener_LocalMessageReceived ( object sender, MessageReceivedEventArgs e){ ParseNavRequest( e.Message );}
Min-Hong...
Contributor
3375 points
377 Posts
11-18-2009 12:01 AM |
Hi
If you are saying you can not find content frame in your childFrams's button click event.
((MainPage)App.Current.RootVisual).contentFrame will do the trick.
If you are have problems while download xap on demand , i recommand you to watch this video.
http://silverlight.net/learn/learnvideo.aspx?video=65687
It's only 20 minutes , and will guide you to establish a download on demand application from ground up.
Best Regards