所有应用程序窗口的WPF图标 [英] WPF Icon for all app windows
问题描述
可以设置一个图标,以便在当前应用程序的每个窗口中使用它。所以我设置了一次(不是手动每个窗口)..?
It is possible to set one Icon so, that it would be used on every window in current app. So that i set it once (not on every window by hand)..?
推荐答案
关于这个问题的一个很好的参考是这里 MSDN 。您有一个应用程序图标(桌面图标),每个窗口一个的状态。
A good reference on the subject is here MSDN. States that you have an Icon for the Application (Desktop Icon), and one for each Window.
WPF窗口始终显示一个图标。如果未通过设置图标提供,则WPF会根据以下规则选择要显示的图标:
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.
如果未指定程序集图标,请使用默认的Microsoft Windows图标。
If the assembly icon is not specified, use the default Microsoft Windows icon.
社区内容参考:
小贴士:如果您设置应用程序图标并希望看到它窗口 - 如果从VS运行调试它不会出现。运行外部或不连接(ctrl + f5)图标显示为预期。
"A liitle tip : if you set the application icon and expect to see it on the window - it wont show up if running in debug from VS. Running externally or without attaching (ctrl + f5) the icon displays as expected."
这篇关于所有应用程序窗口的WPF图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!