The simplest XAML solution would be (inspired by @Funk):
UPDATE: As said in comments this works now for Android and iOS (a Xamarin.Android bug was fixed)
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="8*" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<BoxView x:Name="thebox" Grid.Column="1" Grid.Row="1" BackgroundColor="Aqua" HeightRequest="{Binding Source={x:Reference thebox}, Path=Width}" />
</Grid>
Result:

Hard way (works on Android and iOS):
I made a ad-hoc solution for your case assuming you want to use a BoxView
.
I've extended BoxView
and forced the wight to be the same as width. You can play with it for other results.
The XAML will look like:
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="forms_pcl.MyPage" xmlns:local="clr-namespace:forms_pcl;assembly=forms_pcl">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="8*" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="8*" />
<RowDefinition />
</Grid.RowDefinitions>
<local:SquareBox HorizontalOptions="CenterAndExpand" VerticalOptions="Center" BackgroundColor="Aqua" Grid.Column="1" Grid.Row="1" />
</Grid>
</ContentPage>
NOTE: The flags HorizontalOptions="CenterAndExpand" VerticalOptions="Center"
are mandatory to force the GetSizeRequest
to be called for height and width.
And SquareBox will look like:
public class SquareBox : BoxView
{
public override SizeRequest GetSizeRequest(double widthConstraint, double heightConstraint)
{
return new SizeRequest(new Size(widthConstraint, widthConstraint), new Size(widthConstraint, widthConstraint));
}
}
Result:
