更改部分信任WPF xbap的图标和标题

发布于 2024-09-07 17:44:17 字数 113 浏览 2 评论 0原文

我一直在摆弄部分信任的 XBAP - 如何更改 IE 选项卡和标题中显示的图标(除了更改项目属性中的程序集名称)?

我还想更改 Internet 标头中显示的内容(现在它显示 XBAP 的地址)。

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 Internet header (right now it shows the address of the XBAP.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

私野 2024-09-14 17:44:17

我遇到了类似的问题,我无法更改 IE 10 中的标题(这是当您 Google“xbap title”时出现的第一个堆栈溢出答案)。我找到了解决方案 此处

在代码中,将 Application.Current.MainWindow.Title 设置为您要显示的标题。这对我有用,希望对下一个人有帮助。

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.

少跟Wǒ拽 2024-09-14 17:44:17

使用 IFRAME 从 HTML 页面加载 XBAP。在 HTML 页面中添加标题和图标。

像这样的事情:

<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>

这是从我实际使用的代码中简化的,除了由于一些其他要求,我给 iframe 一个 id 并在正文的 onload 事件中使用 JavaScript 设置其位置。我认为上面的方法也同样有效。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文