Description
Almost all in the title. So an ImageButton doesn't allow {x:Type ImageButton} to be assigned as a value to the TargetType property in a Trigger of its style. Doing so yields the famous "Object reference not set to an instance of an object." error which prevents the build from completing. It doesn't matter where the trigger is defined (Default Style in Styles.xaml, in the control itself, in the resources of a containing element...)
Steps to Reproduce
- Create a MAUI app.
- Create an
ImageButton
- Give it a style in which a trigger is defined and set the
TargetType property of that trigger "{x:Type ImageButton}".
- Build fails
Link to public reproduction project repository
No response
Version with bug
8.0.0-rc.2.9373
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android, Windows, I was not able test on other platforms
Affected platform versions
No response
Did you find any workaround?
Set the TargetType property to "ImageButton" instead.
Relevant log output
No response