Friday, February 1, 2013

open a silverlight window in a new tab

open a silverlight window in a new tab

i have a silverlight window, when a button pressed i want to open it on a new tab\window, how can i do it?

Answers & Comments...

Answer: 1

The HtmlPage.Window.Navigate() method has an overload which allows you to specify which frame to load the new page in. _blank is used for new window/tab.

HtmlPage.Window.Navigate(new Uri("http://google.com"), "_blank"); 
by : Charlie Somervillehttp://stackoverflow.com/users/47322

Answer: 2

You can use a HyperlinkButton for this.

<HyperlinkButton NavigateUri="http://www.silverlight.net" TargetName="_blank" Content="HyperlinkButton"/> 

When you specify "_blank" as TargetName. A new tab or window is opened and the specified uri gets opened. Also other values for TargetName are valid. See here more.

Edit:

To open the same Silverlight application in a new tab you can use the System.Windows.Browser.HtmlPage.Document.DocumentUri as NavigationUri of the HyperlinkButton.

by : Jehofhttp://stackoverflow.com/users/83039

Answer: 3

Taking your question literally the answer is:-

HtmlPage.Window.Navigate(HtmlPage.Document.DocumentUri, "_blank");  
by : AnthonyWJoneshttp://stackoverflow.com/users/17516

Answer: 4

The only thing you can open 'in a new tab' is a web page. If you want to open a different Silverlight application in a new tab, then it will need to be hosted in a webpage, and you will need to use HtmlPage.Window.Navigate() to open that page. You cannot just open a new tab and have it somehow contain something embedded in your application - that is not how webbrowsers work.

by : SmartyPhttp://stackoverflow.com/users/18005

Answer: 5

Also try this in .aspx Page

<head id="Head1" runat="server">     <title>Your Applicateion</title>     <script type="text/javascript">         var windowClose = window.close;         window.close = function () {             window.open("", "_self");             windowClose();         }         function OpenWindow() {             window.opener = 'x';             window.close();                         window.open('Default.html', '_blank', 'status=no,toolbar=no,location=no,menubar=no,directories=no,resizable=no,scrollbars=no,height=' + screen.availHeight + ',width=' + screen.availWidth + ',top=0,left=0');             return false;         }     </script> </head> <body onload="OpenWindow();">     <form id="form1" runat="server">     </form> </body> 
by : Manoj Savaliahttp://stackoverflow.com/users/780955

Answer: 6

Rather than using the URI like people here are suggesting you should just create an object of your page and pass it to the navigate method.

Dim yournewpage as new OrganiztrionInfoFromToolTip() HtmlPage.Window.Navigate(yournewpage, "_blank"); 
by : Zelxinhttp://stackoverflow.com/users/2030351




No comments:

Post a Comment

Send us your comment related to the topic mentioned on the blog