Skip to content

Instantly share code, notes, and snippets.

@davidortinau
Last active July 27, 2022 15:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidortinau/175b945ebab8448a86fe4b91d3f8b3eb to your computer and use it in GitHub Desktop.
Save davidortinau/175b945ebab8448a86fe4b91d3f8b3eb to your computer and use it in GitHub Desktop.
<ControlTemplate x:Key="CalendarRadioTemplate">
<Frame BorderColor="#F3F2F1" BackgroundColor="#F3F2F1" HasShadow="False"
HeightRequest="100" WidthRequest="100" HorizontalOptions="Start" VerticalOptions="Start" Padding="0">
<VisualStateManager.VisualStateGroups>
<VisualStateGroupList>
<VisualStateGroup x:Name="CheckedStates">
<VisualState x:Name="Checked">
<VisualState.Setters>
<Setter Property="BorderColor" Value="#FF3300"/>
<Setter TargetName="Check" Property="Opacity" Value="1"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Unchecked">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="#f3f2f1"/>
<Setter Property="BorderColor" Value="#f3f2f1"/>
<Setter TargetName="Check" Property="Opacity" Value="0"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</VisualStateManager.VisualStateGroups>
<Grid Margin="4" WidthRequest="100">
<Grid WidthRequest="18" HeightRequest="18" HorizontalOptions="End" VerticalOptions="Start">
<Ellipse Stroke="Blue" WidthRequest="16" HeightRequest="16" StrokeThickness="0.5" VerticalOptions="Center" HorizontalOptions="Center" Fill="White" />
<Ellipse x:Name="Check" WidthRequest="8" HeightRequest="8" Fill="Blue" VerticalOptions="Center" HorizontalOptions="Center" />
</Grid>
<ContentPresenter></ContentPresenter>
</Grid>
</Frame>
</ControlTemplate>
@Cfun1
Copy link

Cfun1 commented Dec 10, 2020

throwing the error:

Expected Setter but found Xamarin.Forms.Frame. Property not set.

When removed <VisualStateGroupList> everything becomes ok.

@Darina1801
Copy link

throwing the error:

Expected Setter but found Xamarin.Forms.Frame. Property not set.

When removed <VisualStateGroupList> everything becomes ok.

But selection doesn't work this way. At least for me. The RadioButton stays checked and doesn't сhange.
How did you tackle the problem?
Or it worked for you anyway?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment