views:

1317

answers:

1

LearnWPF.com posted this article about converting bitmap images to XAML and using them in your applications.

The outer element of the XAML image is a Canvas. However, the Window.Icon property only accepts an ImageSource object. Does anyone know how I can 'wrap' the Canvas in an ImageSource so I can use it as a window icon?

Alternatively, is there a better way to use a XAML image as a window icon?

+7  A: 

The WPF window Chrome(header bar, Icon etc) are part of the typical Win32 Window system. So it was not build to use with Vector Icon, you need to specify an .Ico file to the Window.Icon property.

But if you really want to make a Vector(XAML) animating Icon, you need to think about the concept of Chrome less window. That means gets rid of the old style window chrome(WIndowStyle="None") and build our own chrome entirely with WPF, then you can place your Vector directly over the left top corner and it will just work as you do with any other XAML Visuals in the application.

Read more about how to create Chromeless window on bellow links

Jobi Joy