Solution1:
You could use ViewExtensions.FadeTo(VisualElement, Double, UInt32, Easing) Method
to perform the fade.
ViewExtensions.FadeTo(VisualElement, Double, UInt32, Easing) Method
:
https://learn.microsoft.com/en-us/dotnet/api/xamarin.forms.viewextensions.fadeto?view=xamarin-forms
I use BoxView
for example.
Xaml:
<BoxView
x:Name="boxView"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"
Color="Accent" />
Code:
public Page26()
{
InitializeComponent();
Animation();
}
private bool _isAnimate;
private async void Animation()
{
var fade = 1.0;
_isAnimate = true;
while (_isAnimate)
{
await boxView.FadeTo(Fade(), 1000, Easing.Linear);
}
double Fade()
{
fade = fade == 1 ? 0.1 : 1;
return fade;
}
}

The GIF is a bit jittery but on device, the animation is smooth.
Updated:
You could use the boxview
as the background color and do the overlap for the controls.
<Grid>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<BoxView
x:Name="boxView"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"
Color="Accent" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Grid.RowSpan="3"/>
<Button Grid.Row="1" Grid.Column="1" Text="Button" BackgroundColor="Black" TextColor="White"></Button>
</Grid>

For more about overlap, you could check the link below.
How do overlap in Xamarin forms?
Solution2:
Set the name of ContentPage.
<ContentPage
……
x:Name="page">
MainPage.xaml.cs:
public MainPage()
{
InitializeComponent();
Animation();
}
private bool _isAnimate;
private async void Animation()
{
var fade = 1.0;
_isAnimate = true;
while (_isAnimate)
{
await page.FadeTo(Fade(), 1000, Easing.Linear);
}
double Fade()
{
fade = fade == 1 ? 0.1 : 1;
return fade;
}
}
