Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Navigation framework in tabs

Navigation framework in tabs

Scheduled Pinned Locked Moved WPF
questionhelptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tcook815
    wrote on last edited by
    #1

    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.

    M 1 Reply Last reply
    0
    • T tcook815

      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.

      M Offline
      M Offline
      Michael Sync
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups