更改部分信任WPF xbap的图标和标题
我一直在摆弄部分信任的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我遇到了类似的问题,我无法更改 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.使用 IFRAME 从 HTML 页面加载 XBAP。在 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:
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.