开发者

Changing icon and title of partial trust WPF xbap

开发者 https://www.devze.com 2023-01-05 16:11 出处:网络
I\'ve been fiddling with a partial trust XBAP - how can I change the icon shown in the IE-tab and the title (aside from changing the assembly-name in the project properties)?

I've been fiddling with a partial trust XBAP - how can I change the icon shown in the IE-tab and the title (aside from changing the assembly-name in the project properties)?

I would also like to change what is shown in the In开发者_开发问答ternet header (right now it shows the address of the XBAP.


I had a similar issue where I could not change the title in IE 10 (this was the first stack overflow answer that comes up when you Google "xbap title"). I found the solution here:

In code, set Application.Current.MainWindow.Title to the title you want to show. This worked for me, hopefully this will be helpful for the next guy.


Load your XBAP from a HTML page using an IFRAME. In the HTML page add a title and icon.

Something like this:

<html>
  <head>
    <title>This is my title</title>
    <link rel="shortcut icon" href="http://wherever.com/icon.ico">
  </head>
  <body>
    <iframe location="something.xbap"
            style="width:100%; height:100%; border:0; overflow:auto" scrolling="no"></iframe>
  </body>
</html>

This is simplified from code that I actually use, except due to some other requirements I'm giving the iframe an id and setting its location using JavaScript in the body's onload event. I assume the above will work just as well.

0

精彩评论

暂无评论...
验证码 换一张
取 消