我需要在我的菜单标题中有图片而不是文本。我写了一段代码,但没有显示图像。WPF菜单和标题图片
以下是我的xaml部分。
<Menu Height="50" Width="50" VerticalAlignment="Top" IsMainMenu="True">
<MenuItem Height="50" Width="50">
<MenuItem.Header>
<Image HorizontalAlignment="Left" Height="50" VerticalAlignment="Top" Width="50" Source="Images/pulsesi_icon_black.PNG"/>
</MenuItem.Header>
</MenuItem>
</Menu>
帮帮我吧,我不需要图标。
'Image.Source'路径可能是错误的。你确定,你在同一个项目和图像'BuildAction'设置为'Resrouce'的图像? – sthotakura