tags:

views:

1607

answers:

2

I need to know how to set the very top left icon / image on a WPF page. I know how to do it in a WPF Window the page looks to be different.

Thanks,

Darren

+1  A: 

Hi Darren,

Are you referring to a WPF application deployed as an XBAP, if so the same rules apply as a normal website and you would just place a favicon.ico in the root of your IIS website.

http://en.wikipedia.org/wiki/Favicon

mattcodes
No I'm referring to the System.Windows.Controls.Page class. I need to change the Icon on the Title bar.
Darren C
+1  A: 

I don't think there's any support for changing the host window's icon based on its current page in a navigation-style application.

One workaround might be to introduce a property of type Image into your pages (perhaps derive all your pages from a base page, or introduce an IHasIcon interface and implement that), then bind the host window's icon to that. Something along the lines of:

<Window ...
    Icon="{Binding Content.Icon,ElementName=frame1>
    <Frame x:Name="frame1" ... />
</Window>

I haven't tried this but I've done similar things with binding a TextBlock to the "title" of the current page in a navigation application.

Matt Hamilton
I got it. You need to create your own Navigation Window in order to set all of those window properties. Thanks for your response.
Darren C