Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

using two projects in one project RSS

7 replies

Last post Jan 02, 2009 04:13 PM by APIJunkie

(0)
  • qingquan126778

    qingquan126778

    Member

    2 Points

    35 Posts

    using two projects in one project

    Dec 22, 2008 12:20 PM | LINK

    hello,everyone,

      i have a question. in one project i added another project, so, when i click a button that is in the main project,it will display another project.

     how i can make the two projects changed  well using the event.

  • bryant

    bryant

    Star

    10113 Points

    1662 Posts

    Re: using two projects in one project

    Dec 22, 2008 05:01 PM | LINK

    -- bryant

    Blog | Twitter
    _________________
    Dont forget to click "Mark as Answer" on the post that helped you.
  • qingquan126778

    qingquan126778

    Member

    2 Points

    35 Posts

    Re: using two projects in one project

    Dec 23, 2008 12:28 AM | LINK

    i saw this source.but it only about two pages in one project,

    i mean than i want to use two project well.

    i want to change two projects using the event.

    can u give me email,i send the soure to you.

    help me,please.

  • bryant

    bryant

    Star

    10113 Points

    1662 Posts

    Re: using two projects in one project

    Dec 23, 2008 12:32 AM | LINK

    If you can reference project 1 from project 2, then you should be able to do the same thing (you'll just have a different namespace).

    However, if you have a seperate xap (the project doesn't have a reference) then you'll need to dynamically load the second application. There is a post here that does exactly this on Mike Snow's blog.

    -- bryant

    Blog | Twitter
    _________________
    Dont forget to click "Mark as Answer" on the post that helped you.
  • qingquan126778

    qingquan126778

    Member

    2 Points

    35 Posts

    Re: using two projects in one project

    Dec 23, 2008 01:51 AM | LINK

    i had read this post, it was used the asp.net to achieve the change of two projects,

    but in my project i didn't use asp.net,the two projects were made by silverlight,

    so i want to know how i can achieve the change of two projects using the .....xap file of the two projects.

  • bryant

    bryant

    Star

    10113 Points

    1662 Posts

    Re: using two projects in one project

    Dec 23, 2008 04:17 AM | LINK

    You're right, that is server side. I coded up a sample and stuck it all in a blog post. Let me know if that works for you.

    -- bryant

    Blog | Twitter
    _________________
    Dont forget to click "Mark as Answer" on the post that helped you.
  • qingquan126778

    qingquan126778

    Member

    2 Points

    35 Posts

    Re: using two projects in one project

    Dec 23, 2008 08:00 AM | LINK

    thanks for your answering,but i'm sorry that was not i want to get.

    like your example,don't use the htm,

    when i click the TextBlock in the first project,it will display the second project ,

    and when i click the TextBlock in the second project ,it will display the first project,

    can you help me again?

  • APIJunkie

    APIJunkie

    Member

    28 Points

    15 Posts

    Re: using two projects in one project

    Jan 02, 2009 04:13 PM | LINK

    Hi,

    What you can do is use the html bridge to change the source of the XAP file from your managed code.

    This is demonstrated in the silverlight splashscreen/loader project on code plex.

    Example:

    // set the source of the current silverlight plugin

    // note that changing this will effectively change the XAP file that is currently in use!

    // the new XAP will be initialized and displayed in the browser replacing the old XAP source

    public static void setCurrentXapFile(Uri packageSource)

    {

      string path = packageSource.ToString();

      System.Windows.Browser.HtmlPage.Plugin.SetProperty("source", path);

    }

    Hope this helps!