TLDR: When setting the Triggers property in XAML, use the actual type of the parent tag, not a supertype.
After recently updating Xamarin Forms from
220.127.116.11, I started getting an
InvalidOperationException: The BindableProperty "Triggers is readonly" inside
Unlike many problems, this was quite easy to track down.
InitializeComponent errors are generally XAML, and in the page in question there was a single
Trigger. In this case the solution was simple. The
Trigger was on a custom Button type, but I was setting it specifically using
Button.Triggers. Changing it to be the actual type fixed it.
So, I changed it from
<local:MyButton> <Button.Triggers> <DataTrigger ... /> </Button.Triggers> </local:MyButton>
<local:MyButton> <local:MyButton.Triggers> <DataTrigger ... /> </local:MyButton.Triggers> </local:MyButton>
I believe the original should be valid (and previously was) but the change is simple enough to not be a big problem.