WPF JumpList图标无法正常显示问题求助
WPF JumpList图标无法显示问题
我在WPF应用中配置了JumpList,功能整体可正常运行,但图标无法显示。
以下是创建JumpTask的代码:
using System.Windows.Shell; public JumpTask BuildJumpTask { get { return new JumpTask { Arguments = Argument, ApplicationPath = Assembly.GetEntryAssembly()?.Location, Description = GenerateDescription(), IconResourcePath = GetIconPath(), Title = Name }; } } private string GetIconPath() { return Type switch { JumpListItemType.About => Path.GetFullPath(@"Assets\Icons\JumpList\About.ico"), JumpListItemType.Help => Path.GetFullPath(@"Assets\Icons\JumpList\Help.ico"), JumpListItemType.Quit => Path.GetFullPath(@"Assets\Icons\JumpList\Quit.ico"), JumpListItemType.Settings => Path.GetFullPath(@"Assets\Icons\JumpList\Settings.ico"), JumpListItemType.Sign_Out => Path.GetFullPath(@"Assets\Icons\JumpList\Sign_Out.ico"), _ => null! }; }
所有.ico文件已输出至预期目录,文件属性设置如下:
- Build Action: Embedded resource(也尝试过Content)
- Copy to Output Directory: Copy if newer
内容的提问来源于stack exchange,提问作者Richard Gale
相关产品推荐
相关产品推荐

