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:
-
Use the assembly icon, if specified.
-
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);