WPF:Window Icon

http://msdn.microsoft.com/en-us/library/system.windows.window.icon.aspx

A WPF window always displays an icon. When one is not provided by setting Icon, WPF chooses an icon to display based on the following rules:

  1. Use the assembly icon, if specified.

  2. If the assembly icon is not specified, use the default Microsoft Windows icon.

可以使用程序集级别的icon,也可以自己指定

// Set an icon using code
Uri iconUri = new Uri("pack://application:,,,/WPFIcon2.ico", UriKind.RelativeOrAbsolute);
this.Icon = BitmapFrame.Create(iconUri);
原文地址:https://www.cnblogs.com/chenxizhang/p/1649087.html