[SOLVED] The BindableProperty "Triggers" is readonly

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 to, I started getting an InvalidOperationException: The BindableProperty "Triggers is readonly" inside InitializeComponent. 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>

to local:MyButton local:MyButton.Triggers <DataTrigger … /> </local:MyButton.Triggers> </local:MyButton>