CommunityToolkit / CommunityToolkit/Maui

[BUG] AvatarView not applying style from resources

Open
#3,241 1 comment 0 reactions 0 assignees View on GitHub
bug unverified
Dominant language
C#
Stars
2.7k
Forks
500
Avg merge
2d 14h
Merged PRs (30d)
7

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Did you read the "Reporting a bug" section on Contributing file?

- [x] I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug

### Current Behavior

If you define AvatarView Style property value using ContentPage Resource like below,
```


<Setter Property="StrokeThickness"
Value="5" />
<Setter Property="Stroke"
Value="Red" />




```
the AvatarView will not apply the style, but when assigned directly

``

it will apply the settings

### Expected Behavior

The setting should be applied either when set via style or directly

### Steps To Reproduce

1. Open and run the reproduction project
2. Observe the AvatarView, the styling in the ContentPage Resources will not apply
3. Set the styling directly and run again, the styling will apply

### Link to public reproduction project repository

https://github.com/Dadibe/AvatarView-Style.git

### Environment

```markdown
- .NET MAUI CommunityToolkit: 14.2.0
- OS: Windows 11 Pro Build 22000.2538
- .NET MAUI: 10.0.301
```

### Anything else?

Tested on Android only (both on Emulator and Physical Device)

Contributor guide

Open the contributing guide

Research direction

Start by running the linked AvatarView-Style reproduction project and inspect the AvatarView entry point to compare resource-based styling with direct property assignment. Verify the fix on Android by confirming that StrokeThickness and Stroke from the ContentPage resource style are applied just like the directly assigned values.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.