C# WPF按钮图像未显示
我创建了一个带有图像的按钮:C# WPF按钮图像未显示,c#,wpf,C#,Wpf,我创建了一个带有图像的按钮: <Button x:Name="btnAddRow" Grid.Row="0" Grid.Column="5" Margin="5, 5" Command="{Binding CmdAddRow}"> <Image Source="pack://application:,,,/Resources/help_16.png" Stretch="None" HorizontalAlignment="Center" /> </Butto
<Button x:Name="btnAddRow" Grid.Row="0" Grid.Column="5" Margin="5, 5" Command="{Binding CmdAddRow}">
<Image Source="pack://application:,,,/Resources/help_16.png" Stretch="None" HorizontalAlignment="Center" />
</Button>
图像作为资源包含。在设计器中,将显示图像(蓝色帮助图标):
但在运行时,它不会显示:
有人能帮帮我吗,这里有什么问题吗
非常感谢。构建操作已设置为资源。但是它没有显示。也尝试了-现在成功了。没有成功:也没有成功:DhlConnector是我的Assemblyname。你使用Prism对吗?而
Resources
文件夹位于模块上,而不是文件夹中?Buildaction设置为resource。但是它没有显示。也尝试了-现在成功了。没有成功:也没有成功:DhlConnector是我的Assemblyname。你使用Prism对吗?而Resources
文件夹位于模块上,而不是文件夹中?