You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.11 22:30:53