Navigation framework in tabs
-
Hello, I have a Silverlight 3 application where I use a tab control and I want to implement the navigational framework into it. The tabs on my page are created dynamically by the user, saying this
TabItem ti = new TabItem(); Frame frame = new Frame(); ti.Content = frame; MyTabs.Items.Add(ti);
When the user clicks a link, I want content to load into whichever tab is currently selected, so I say this
HyperlinkButton btn = sender as HyperlinkButton; string url = btn.Tag.ToString(); Frame frame = MyTabs.SelectedContent as Frame; frame.Navigate(new Uri(url, UriKind.Relative));
The current tab loads the page into its frame correctly. However, as I click through the other tabs, they also have loaded the page into their frames, so all open tabs have the exact same content. So for example, the user has 5 tabs open. They click a link, and the currently selected tab loads a Page into its Frame. If they go to one of the four other tabs, they see that those tabs also loaded the same Page. How can I make sure that only the selected tab gets its new Page and not the other tabs? Thanks to anyone who can help.
-
Hello, I have a Silverlight 3 application where I use a tab control and I want to implement the navigational framework into it. The tabs on my page are created dynamically by the user, saying this
TabItem ti = new TabItem(); Frame frame = new Frame(); ti.Content = frame; MyTabs.Items.Add(ti);
When the user clicks a link, I want content to load into whichever tab is currently selected, so I say this
HyperlinkButton btn = sender as HyperlinkButton; string url = btn.Tag.ToString(); Frame frame = MyTabs.SelectedContent as Frame; frame.Navigate(new Uri(url, UriKind.Relative));
The current tab loads the page into its frame correctly. However, as I click through the other tabs, they also have loaded the page into their frames, so all open tabs have the exact same content. So for example, the user has 5 tabs open. They click a link, and the currently selected tab loads a Page into its Frame. If they go to one of the four other tabs, they see that those tabs also loaded the same Page. How can I make sure that only the selected tab gets its new Page and not the other tabs? Thanks to anyone who can help.
Have you tried using Prism V2 (CompositeWPF)? There is a TabRegaion Adapter that you can use.
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) Microsoft MVP (Silverlight), WPF/Silverlight Insiders