I have a RadioButton Style & ControlTemplate, and when using them for more than one RadioButton, a large amount of whitespace is added above & below the containing Grid. Here is the design part of the ControlTemplate:
<Grid BackgroundColor="Transparent" Padding="0" HorizontalOptions="Fill" Margin="0" VerticalOptions="Fill" ColumnSpacing="5">
<Grid.RowDefinitions><RowDefinition Height="*"/></Grid.RowDefinitions>
<Grid.ColumnDefinitions><ColumnDefinition Width="Auto"/><ColumnDefinition Width="Auto"/></Grid.ColumnDefinitions>
<Grid BackgroundColor="Transparent" Padding="0" Margin="0" HorizontalOptions="Fill" VerticalOptions="Fill">
<Ellipse Stroke="Black" WidthRequest="24" HeightRequest="24" StrokeThickness="2" VerticalOptions="Center" HorizontalOptions="Center" Fill="Transparent"/>
<Ellipse x:Name="Check" WidthRequest="14" HeightRequest="14" Fill="Black" VerticalOptions="Center" HorizontalOptions="Center"/>
</Grid>
<ContentPresenter Grid.Column="1" BackgroundColor="Transparent" HorizontalOptions="Fill" Margin="0" Padding="0" VerticalOptions="Fill"/>
</Grid>
When there is only one RadioButton, it looks as I would expect. However, if there are multiple RadioButton(s), extra whitespace gets added above & below the Grid. Here are screenshots of the Grid with three & one RadioButton:
I found that if I remove either the Grid containing the Ellipse(s) or the ContentPresenter from the ControlTemplate (either one, it just won't let me have both) it works fine, but if both are there having multiple RadioButtons causes extra whitespace above & below the Grid containing the RadioButtons. Why is this space being added when there are multiple RadioButton(s)? Thanks.