Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

Open a new browser window that only shows the silverlig... RSS

8 replies

Last post Jul 14, 2010 05:54 AM by avp

(0)
  • theDawckta

    theDawckta

    Member

    3 Points

    18 Posts

    Open a new browser window that only shows the silverlight application

    May 25, 2010 10:15 PM | LINK

    Hello,

    I need to open a new popup window with only my xap in it.  Currently I was trying to accomplish this using code similiar to the folowing;

      

    HtmlPopupWindowOptions options = new HtmlPopupWindowOptions();
    
                options.Menubar = false;
                options.Resizeable = false;
                options.Status = false;
                options.Toolbar = false;
                options.Directories = false;
                options.Scrollbars = false;
                options.Location = false;
                options.Height = 229;
                options.Width = 690;
    
                HtmlPage.PopupWindow(Uri, "_blank", options);
     

    The above method does not work because I need to load only the xap file in the new window. The functionality is detaching a video player so the user can continue browsing the page. Is there a way to launch a new window from inside the xap that only contains the xap code, so basicaly just the SL object.

  • sladapter

    sladapter

    All-Star

    43609 Points

    7910 Posts

    Re: Open a new browser window that only shows the silverlight application

    May 25, 2010 10:22 PM | LINK

    Silverlight app need to be hosted in a HTML page. So you just need to have a HTML Page (like the one of your TestPage.html) that contains Silverlight object tag which point to the Xap file you want to use. Then you can open a popup window using this page URL, not URL of the xap. 

     

     

    Sally Xu
    Software Engineer
    Aprimo, Inc

    Please remember to mark the replies as answers if they answered your question
  • theDawckta

    theDawckta

    Member

    3 Points

    18 Posts

    Re: Re: Open a new browser window that only shows the silverlight application

    May 25, 2010 10:34 PM | LINK

    Is that the only way?  Is there any way to accomplish something like this without a page set up with just the xap on it.

  • sladapter

    sladapter

    All-Star

    43609 Points

    7910 Posts

    Re: Re: Open a new browser window that only shows the silverlight application

    May 26, 2010 12:49 AM | LINK

    That is the only way.  XAP file is for Silverlight object tag. Browser does not know how to display XAP file.

    But I'm curious about what you are trying to do. 

    The code you are showing is in Silverlight which means you already have a Silverlight application. And you want to open a new Browser window to start another Silverlight application? I'm not saying you can't do this, it's just little odd to me.

    Maybe what you really want is to display another Silverlight Page within your Silverlight app in a Silverlight ChildWindow or Popup?

     

     

    Sally Xu
    Software Engineer
    Aprimo, Inc

    Please remember to mark the replies as answers if they answered your question
  • jackbond

    jackbond

    Contributor

    5812 Points

    1559 Posts

    Re: Re: Open a new browser window that only shows the silverlight application

    May 26, 2010 01:26 AM | LINK

    If you want the Silverlight app to fill the entire browser window, that's the behavior for the default silverlight template apps.
  • hufit

    hufit

    Member

    170 Points

    47 Posts

    Re: Open a new browser window that only shows the silverlight application

    May 31, 2010 05:27 AM | LINK

    Hi, I think you can't do this because Silverlight app is hosted on html page. You can create a Child Window or Pop up in Silverlight.
  • AVP

    AVP

    Member

    6 Points

    5 Posts

    Re: Open a new browser window that only shows the silverlight application

    Jul 12, 2010 12:04 PM | LINK

    Hi,

    I have a query regarding opening silverlight application in new browser. I have a silverlight application where i show a search text box and a button. I display some results in a tree view on completeing the search using textbox and a button. I want to open the same page in separate browser when i click on a tree node and i want to display one more textbox on the same page when opened in new browser window. Can we achieve this?

    Thanks & Regards. 

    silberlight 3 application in new browser.

  • sladapter

    sladapter

    All-Star

    43609 Points

    7910 Posts

    Re: Open a new browser window that only shows the silverlight application

    Jul 12, 2010 01:50 PM | LINK

    Yes, you use HtmlPage.Window.Navigate(new Uri(URLOfHTMLPageContainsYourSilverlightApp), "_blank")'; to open another browser window.  The HTML page on that window should contains your Silverlight application.






    Sally Xu
    Software Engineer
    Aprimo, Inc

    Please remember to mark the replies as answers if they answered your question
  • AVP

    AVP

    Member

    6 Points

    5 Posts

    Re: Open a new browser window that only shows the silverlight application

    Jul 14, 2010 05:54 AM | LINK

    Hi.. thanks for your reply.

    I have hosted my silverlight application on aspx page and calling this aspx page (using Navigate as shown in your example.). I am also able to open the application in new browser but i am not able to change any property of any control. E.g. I am passing some keyword to the aspx page (page on which SL application is hosted) and again passing same keyword using InitParam on xaml page. Now i want to display this keyword in one of the text boxes in SL application (in new browser). I am not able to display this keyword in SL application opened in new browser.

    Can you please help?