Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
Current Behavior
The AvatarView that has its ImageSource property initially null unexpectedly changes size when updating its ImageSource property.
Expected Behavior
The AvatarView should keep its 32x32 size.
Steps To Reproduce
- Open and run the solution from the reproduction repository
- Observe the AvatarView respecting the 32x32 size, being entirely displayed within its circular border.
- Press the button
- Observe the Avatar displaying the image (which replaces the text) and growing to exceed the 32x32 size, the circle and part of the image being cropped.
- Press the button once more
- Observe the AvatarView being resized to its original, correct size.
Link to public reproduction project repository
https://github.com/Jean-RobertLaffineur/AvatarViewSizingIssue
Environment
- .NET MAUI CommunityToolkit: 14.0.1
- OS: Windows 11 Enterprise (25H2)
- .NET MAUI: 10.0.50
Anything else?
Workaround
Manually changing the WidthRequest or HeightRequest to a different value (such as WidthRequest - 1) forces the resize and allows working around the cropped image issue.