Open the Silverlight window in a new tab

I have a silverlight window, and when the button is clicked, I want to open it in a new window of the \ tab. How can i do this?

+3
source share
6 answers

The only thing you can open “in a new tab” is a web page. If you want to open another Silverlight application in a new tab, it must be placed on the web page, and you will need to use HtmlPage.Window.Navigate () to open this page. You cannot just open a new tab and make it somehow add something to your application - this is not how web browsers work.

-3
source

HtmlPage.Window.Navigate() , , . _blank /.

HtmlPage.Window.Navigate(new Uri("http://google.com"), "_blank");
+14

, : -

HtmlPage.Window.Navigate(HtmlPage.Document.DocumentUri, "_blank"); 
+7

URI, , .

Dim yournewpage as new OrganiztrionInfoFromToolTip()
HtmlPage.Window.Navigate(yournewpage, "_blank")
+1

HyperlinkButton .

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

"_blank" TargetName. , uri . TargetName. . .

:

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

0
source

Also try this on the .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>
0
source

Source: https://habr.com/ru/post/1743487/


All Articles