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

WPF设计视图中Moniker/Images不显示问题求助

Visual Studio扩展中CrispImage设计视图不显示问题

开发Visual Studio扩展时,按照官方文档使用CrispImage UI元素和Monikers功能,控件在运行时能正常显示图标,但在设计视图中完全不显示。该问题在新建的测试项目中也可复现。

示例XAML代码(已移除样式):

<ToolBarTray x:Name="TopToolbar" DockPanel.Dock="Left" Background="Transparent">
    <ToolBar >
        <Button ToolTip="Refresh" Command="{Binding RefreshCommand}">
            <imaging:CrispImage Width="16" Height="16" Moniker="{x:Static catalog:KnownMonikers.Refresh}" />
        </Button>

设计视图显示效果:
设计视图显示效果

运行时显示效果:
运行时显示效果

完整代码可查看对应项目的GistManagerWindowControl.xaml文件第382行。

内容的提问来源于stack exchange,提问作者stigzler

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.26 05:48:24