我想Grid在后面的代码中设置背景图像。我在互联网上发现我们可以像这样使用 XAML。
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Pages.PhotoPage">
<Grid >
<Image Source="background.png" Aspect="AspectFit" />
<!-- Place here the rest of the layout for the page. -->
</Grid >
但是我怎样才能在后面的代码中设置它。我看不到任何Image或BackgroundImage财产Grid。请帮我。谢谢