locked
XAML XBAP Favicons RRS feed

  • Question

  • I was asked to add an favicons to my xbap browser applications, although I have added the .ico file as a Resource under the property page of the project, how would I add this favicon to the xbap applicaton so that it show up to left of the http:// in the url?

    Tuesday, October 27, 2015 3:35 PM

Answers

  • You could try adding the icon as favicon.ico in the root of your hosting website.

    That might possibly work now, but I should mention it didn't use to.

    The alternative workround people used to use involved an iframe:

    <html>
        <header>
            <link rel="shortcut icon" href="favicon.ico"/>
        </header>
        <body>
          <iframe src="xbap application uri"/>
        </body>
    </html>

    As described here:

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/8ebcb44b-0cd0-4022-a3de-b01974bf4928/how-to-place-logos-on-the-address-bar-in-wpf-xbap-app?forum=wpf


    Hope that helps.

    Technet articles: WPF: MVVM Step 1; All my Technet Articles

    Tuesday, October 27, 2015 3:57 PM
  • You cannot change the hosting web browser's icon from within the XBAP application itself. Trying to set the Icon property of a Page will result in an InvalidOperationException being thrown since setting this property is not allowed nor possible when the application is hosted in a browser due to secuity/permission reasons.

    You could set the icon on the HTML page that hosts your XBAP but how to do this is an ASP.NET topic: http://forums.asp.net

    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't ask several questions in the same thread.

    Tuesday, October 27, 2015 5:06 PM

All replies

  • You could try adding the icon as favicon.ico in the root of your hosting website.

    That might possibly work now, but I should mention it didn't use to.

    The alternative workround people used to use involved an iframe:

    <html>
        <header>
            <link rel="shortcut icon" href="favicon.ico"/>
        </header>
        <body>
          <iframe src="xbap application uri"/>
        </body>
    </html>

    As described here:

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/8ebcb44b-0cd0-4022-a3de-b01974bf4928/how-to-place-logos-on-the-address-bar-in-wpf-xbap-app?forum=wpf


    Hope that helps.

    Technet articles: WPF: MVVM Step 1; All my Technet Articles

    Tuesday, October 27, 2015 3:57 PM
  • You cannot change the hosting web browser's icon from within the XBAP application itself. Trying to set the Icon property of a Page will result in an InvalidOperationException being thrown since setting this property is not allowed nor possible when the application is hosted in a browser due to secuity/permission reasons.

    You could set the icon on the HTML page that hosts your XBAP but how to do this is an ASP.NET topic: http://forums.asp.net

    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't ask several questions in the same thread.

    Tuesday, October 27, 2015 5:06 PM