Thursday, April 19, 2012

Why is my application icon not transparent?

In XAML, I am attempting to bind the window/application icon to an icon on the file system.



In Window.xaml



Icon="{Binding ApplicationIcon}"


In AppViewModel.cs



public ImageSource ApplicationIcon
{
get
{
return new BitmapImage(new Uri(pathReadFromConfigFile));
}
}


When I do this, the icon is shown but it is not transparent. However, if I set the icon within the project (not using binding), the icon is added to the project and it is transparent when I start the application. Why is it acting differently between these two scenarios?





No comments:

Post a Comment