是否有可能在xaml中爲整個網格提供背景圖像和顏色?我沒有縮放圖像,因此有些區域沒有顏色。是否有可能爲網格的其餘部分着色?帶背景圖像和顏色的網格
這是我當前的代碼:
<Grid>
<Grid.Background>
<ImageBrush Stretch="None" ImageSource="Images/background_top.png" AlignmentY="Top" AlignmentX="Center"/>
</Grid.Background>
<Grid.RowDefinitions>
<RowDefinition Height="50*" />
<RowDefinition Height="50*" />
</Grid.RowDefinitions>
</Grid>
這是行不通的,你設置兩次Background屬性。 –