我有一个简单的WPF窗口。我打算将它的背景设置为我作为嵌入式资源添加到项目中的图像之一。这是我尝试过的:
<Window x:Class="A_Boggle.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="A-Boggle" Height="300" Width="625" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" Name="Game">
<Window.Background>
<ImageBrush ImageSource="background.jpg"></ImageBrush>
</Window.Background>
<Grid>
</Grid>
但是,我总是得到这个错误提示:"错误1:文件splash.jpg不是项目的一部分,或者其'Build Action'属性未设置为'Resource'。"
有什么想法吗?